# Scheduled requests

ในการรับ Response สำหรับ **Scheduled request ทุกรายการ** จะต้องส่ง `/getResults` หลังจากส่งคำขอหลักไปแล้ว เมธอด API สำหรับสถิติและการวิเคราะห์ส่วนใหญ่จำเป็นต้องส่ง `/getResults` เพื่อรับไฟล์สถิติหรือ JSON:

* [getAppStats](/th/developer/api-reference/statistics-api/application-subscriber-statistics/#getappstats)
* [getCampaignStats](/th/developer/api-reference/statistics-api/campaign-statistics/)
* [getEventStatistics](/th/developer/api-reference/statistics-api/events-and-tags-statistics/#geteventstatistics)
* [getTagStats](/th/developer/api-reference/statistics-api/events-and-tags-statistics/#gettagstats)
* [getBouncedEmails](/th/developer/api-reference/statistics-api/message-statistics-api/#bouncedemails)

## getResults

`POST` `https://api.pushwoosh.com/json/1.3/getResults`

ดึงผลลัพธ์ของ Scheduled request

#### Request Body

| Name | Type | คำอธิบาย |
| --- | --- | --- |
| auth\* | string | [API access token](/th/developer/api-reference/api-identifiers/#api-access-token) จาก Pushwoosh Control Panel |
| request\_id\* | string | Request ID ที่ส่งคืนโดยเมธอดแบบ scheduled |

```json title="ตัวอย่าง"
{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // จำเป็น API access token จาก Pushwoosh Control Panel
    "request_id": "REQUEST_ID"      // จำเป็น Request ID ที่ส่งคืนโดยเมธอดแบบ scheduled
  }
}
```

<Tabs>
  <TabItem label="200: ตัวอย่าง Response">

    Response จะขึ้นอยู่กับคำขอที่คุณกำลังดึงผลลัพธ์ ดังนั้นหน้าตาอาจแตกต่างกันไป ด้านล่างนี้คือตัวอย่าง response สำหรับคำขอ `/getMsgStats`:

    ```json title="ตัวอย่าง Response"
    {
      "status_code": 200,
      "status_message": "OK",
      "response": {
        "formatter": "hourly",
        "rows": [{
          "datetime": "2020-05-13 08:00:00", 
          "action": "send", 
          "count": 6
        }, {
          "datetime": "2020-05-13 08:00:00",
          "action": "inboxopen",
          "count": 0
        }, {
          "datetime": "2020-05-13 08:00:00",
          "action": "delivery",
          "count": 1
        }, {
          "datetime": "2020-05-13 08:00:00",
          "action": "open",
          "count": 0
        }],
        "conversion": {
          "send": 6,
          "delivery": 1,
          "open": 0,
          "events": []
        }
      }
    }
    ```

  </TabItem>
</Tabs>