Get Viewers Location HTTP Codes

This API is used to get viewers http codes based on locations with 5 minutes data sample.

1. Request Definition

  • API URL
https://cdn-api.swiftfederation.com/v1.0/report/viewers_location_http_codes
  • Request Method
POST
  • Request Header

Refer to HTTP Request Headers

  • Request Body

Request Body Data Format: JSON

Field Required Type Description
domains Mandatory string[] Array of domain names. the limit of array length is 50.
startTime Mandatory string Start time. Format yyyy-MM-ddTHH:mm:ssZ UTC time.
endTime Mandatory string End time. Format yyyy-MM-ddTHH:mm:ssZ UTC time. interval between start time and end time cannot be longer than 4 hours.
  • Request Body Example
{
    "domains": [
        "www.example1.com",
        "www.example2.com"
    ],
    "startTime": "2018-03-29T17:35:00Z",
    "endTime": "2018-03-29T17:45:00Z"
}


2. Response Definition

  • Response Header

Refer to HTTP Response Headers

  • Response Body
Field Type Description
domain string Name of domain.
viewersLocationHttpCodes ViewersLocationHttpCode[] List of viewers location HTTP Code data with 5 minutes interval.
ViewersLocationHttpCode Definition
timestamp string Format yyyy-MM-ddTHH:mm:ssZ UTC time. E.g. 2018-03-29T17:35:00Z will return data from 2018-03-29T17:35:00Z to 2018-03-29T17:39:59Z.
locationHttpCodes LocationHttpCode[] Location HTTP Code includes all countries that viewers accessed from and used volume in this country.
LocationHttpCode Definition
country string Country value is country iso code like VN, SG. *ZZ country code means 'Private' viewers location.
value map<String,Long> HTTP code and it’s number of requests in 5 minutes. Format will be map which includes HTTP code and number of requests for this HTTP code.
  • Response Body Example
[
    {
        "domain": "www.example1.com",
        "viewersLocationHttpCodes": [
            {
                "timestamp": "2018-03-29T17:35:00Z",
                "locationHttpCode": [
                    {
                        "country": "VN",
                        "value": {
                                        "200": 2,
                                        "304": 1
                                    }
                    },
                    {
                        "country": "SG",
                        "value": {
                                        "200": 200,
                                        "206": 12
                                    }
                    }
                ]
            }
        ]
    },
    {
        "domain": "www.example2.com",
        "viewersLocationHttpCodes": [
            {
                "timestamp": "2018-03-29T17:45:00Z",
                "locationHttpCode": [
                    {
                        "country": "VN",
                        "value": {
                                        "200": 825,
                                        "500": 5
                                    }
                    },
                    {
                        "country": "SG",
                        "value": {
                                        "200": 11,
                                        "206": 5
                                    }
                    }
                ]
            }
        ]
    }
]
           Updated 2024-08-26 07:42:13

results matching ""

    No results matching ""