Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to get auth tokens for subsequent API calls
- curl -d '{"publicKey": "f31575ee-ddfd-47d9-87da-f184794b35a4", "refreshToken": "AAHLK9EYuBp_aqISLf4NeGY6WfS_A1EBCB38stqB-xGEyRR0Q7X3iFmJXFwKX2ZtHujYtoA4sWtWigr50r4PKDYC"}' -H "Content-Type: application/json" -X POST https://extapi.stage.jelli.com/api/authentications
- # This will be the output
- {"identity":"f31575ee-ddfd-47d9-87da-f184794b35a4","accessToken":"AAI2C4X7EoClsUR3qustbT2clIlxWJmGrIOl4dScxXVy7namxNtwTKh8LSSbAzMSI6o07ewUuap78JF4spn-VdskAqMiZj3Rz9Rr2i89Ow-63w"}
- # Copy the accessToken to use it in your API calls for data. It should look like this
- curl --header "X-Jelli-Authentication: accessToken=AAI2C4X7EoClsUR3qustbT2clIlxWJmGrIOl4dScxXVy7namxNtwTKh8LSSbAzMSI6o07ewUuap78JF4spn-VdskAqMiZj3Rz9Rr2i89Ow-63w" 'https://extapi.stage.jelli.com/api/v2/metrics?firstWeek=2018-12-10&lastWeek=2018-12-10&networkPartner=a12d0757-18dd-462c-9b4b-fb263d2d661d&metricCategory=booked&metricCategory=reserved&metricCategory=cancelled&metricCategory=aired&metricCategory=bookedDamaged&metricCategory=reservedDamaged&metricCategory=makegood&metric=campaign_impressions&metric=gross_price&metric=net_price&metric=rate&metric=spots&groupBy=advertiser&groupBy=agency&groupBy=buyer&groupBy=campaign&groupBy=orderId&groupBy=plan&groupBy=planDaypart&groupBy=planOrigin&groupBy=planner&groupBy=seller&groupBy=spotDuration&groupBy=inventoryDaypart&groupBy=week&groupBy=broadcaster'
- # Side note. Since there will be alot of data to process, you'll get back something that looks like this in the initial response
- {"message":"query in progress after 10000 milliseconds"}
- # Basically just give it a couple of seconds, then send out the same call. You should get back the data this time, if not, just give it a couple more seconds and try again then write that puppy out to a file if you want to immediately checkout the data
- curl --header "X-Jelli-Authentication: accessToken=AAI2C4X7EoClsUR3qustbT2clIlxWJmGrIOl4dScxXVy7namxNtwTKh8LSSbAzMSI6o07ewUuap78JF4spn-VdskAqMiZj3Rz9Rr2i89Ow-63w" 'https://extapi.stage.jelli.com/api/v2/metrics?firstWeek=2018-12-10&lastWeek=2018-12-10&networkPartner=a12d0757-18dd-462c-9b4b-fb263d2d661d&metricCategory=booked&metricCategory=reserved&metricCategory=cancelled&metricCategory=aired&metricCategory=bookedDamaged&metricCategory=reservedDamaged&metricCategory=makegood&metric=campaign_impressions&metric=gross_price&metric=net_price&metric=rate&metric=spots&groupBy=advertiser&groupBy=agency&groupBy=buyer&groupBy=campaign&groupBy=orderId&groupBy=plan&groupBy=planDaypart&groupBy=planOrigin&groupBy=planner&groupBy=seller&groupBy=spotDuration&groupBy=inventoryDaypart&groupBy=week&groupBy=broadcaster' > data.csv
- # Essentially the output should be a csv file of the data with the first line being all the headers :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement