Advertisement
Guest User

jelli api calls

a guest
Dec 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.73 KB | None | 0 0
  1. How to get auth tokens for subsequent API calls
  2. 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
  3.  
  4. # This will be the output
  5. {"identity":"f31575ee-ddfd-47d9-87da-f184794b35a4","accessToken":"AAI2C4X7EoClsUR3qustbT2clIlxWJmGrIOl4dScxXVy7namxNtwTKh8LSSbAzMSI6o07ewUuap78JF4spn-VdskAqMiZj3Rz9Rr2i89Ow-63w"}
  6. # Copy the accessToken to use it in your API calls for data. It should look like this
  7. 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'
  8.  
  9. # Side note. Since there will be alot of data to process, you'll get back something that looks like this in the initial response
  10. {"message":"query in progress after 10000 milliseconds"}
  11.  
  12. # 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
  13. 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
  14.  
  15. # 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