API query returns 400 error


#1

Hey,

Recently we get 400 error when querying your API for stats.
Here are two queries for example that we get this response for:
https://ads-api.twitter.com/1/stats/jobs/accounts/18ce54b4tu5/?placement=ALL_ON_TWITTER&metric_groups=ENGAGEMENT%2CBILLING%2CMOBILE_CONVERSION&start_time=2017-04-12T00%3A00%3A00-0700&entity=PROMOTED_TWEET&with_deleted=true&end_time=2017-04-13T00%3A00%3A00-0700&granularity=DAY&entity_ids=18583s%2C18583r%2C18583q%2C18583p%2C18583w%2C18583v%2C18583u%2C18583t%2C18583k%2C18583j%2C18583i%2C18583h%2C18583o%2C18583n%2C18583m%2C18583l%2C18583c%2C18583b%2C18583a%2C18583g&segmentation_type=PLATFORMS

https://ads-api.twitter.com/1/stats/jobs/accounts/18ce54dlcu7/?placement=ALL_ON_TWITTER&metric_groups=ENGAGEMENT%2CBILLING%2CMOBILE_CONVERSION&start_time=2017-04-12T00%3A00%3A00%2B0900&entity=PROMOTED_TWEET&with_deleted=true&end_time=2017-04-19T00%3A00%3A00%2B0900&granularity=DAY&entity_ids=17xycl%2C17xycm%2C17xycr%2C17xycs%2C17xycp%2C17xycq%2C17xycv%2C17xycw%2C17xyct%2C17xycu%2C17xycz%2C17xycx%2C17xycy%2C18dhbv%2C180q9z%2C180q9y%2C180q9x%2C180q9s%2C180q9r%2C180q9q&segmentation_type=PLATFORMS

We started seeing this error in the past week, and are getting it very often for a few accounts.

Can you please help us understand why we get this error?
Thanks,
Gili


#2

@ReportsSingular: Could you please post the actual response you’re seeing?

We just ran the query without issues, were able to download the .gz file (after seeing "status": "SUCCESS" on a GET request), and were able to gunzip the file.

Your requests look fine; nothing stands out that would trigger a bad request. You could remove with_deleted=true as this isn’t an actual query parameter for this endpoint (though it won’t affect the request itself).


#3

Hello,

The full response we’re getting: {“errors”:[{“code”:“TOO_MANY_JOBS”,“message”:“A maximum of 100 jobs can be in processing state”}],“request”:{“params”:{“start_time”:“2017-03-19T15:00:00Z”,“segmentation_type”:“PLATFORMS”,“entity_ids”:[“19169r”,“14zv4c”,“14zv4b”,“19169s”,“16p0m3”,“14zv4x”,“14zv4z”,“1916ec”,“195c62”,“16p0j6”,“19169q”,“14zv4w”,“195c63”,“17fyrs”,“17fyrr”,“12x6vm”,“12x6vl”,“195c4t”,“1915dd”,“12x6vi”],“end_time”:“2017-03-24T15:00:00Z”,“placement”:“PUBLISHER_NETWORK”,“account_id”:“18ce5471iih”,“granularity”:“DAY”,“entity”:“PROMOTED_TWEET”,“metric_groups”:[“ENGAGEMENT”,“BILLING”,“MOBILE_CONVERSION”]}}}

For request: https://ads-api.twitter.com/1/stats/jobs/accounts/18ce5471iih/?placement=PUBLISHER_NETWORK&metric_groups=ENGAGEMENT%2CBILLING%2CMOBILE_CONVERSION&start_time=2017-03-20T00%3A00%3A00%2B0900&entity=PROMOTED_TWEET&with_deleted=true&end_time=2017-03-25T00%3A00%3A00%2B0900&granularity=DAY&entity_ids=19169r%2C14zv4c%2C14zv4b%2C19169s%2C16p0m3%2C14zv4x%2C14zv4z%2C1916ec%2C195c62%2C16p0j6%2C19169q%2C14zv4w%2C195c63%2C17fyrs%2C17fyrr%2C12x6vm%2C12x6vl%2C195c4t%2C1915dd%2C12x6vi&segmentation_type=PLATFORMS.

We havnen’t been able to run any successfull query for this account yesterday, can you advise here please?
Thanks!


#4

@ReportsSingular: Thanks for the additional information. As the error message states, the maximum number of concurrent jobs is 100.

Curious to know how long these requests are taking. That is, how long are jobs in the PROCESSING state?