Async job - URL comes as null


#1

Sometime the async job status returns the URL as null. Could you please help with the same.

JobStatus{“request”:{“params”:{“job_ids”:[906196929771593729]}},“next_cursor”:null,“data”:[{“start_time”:“2016-12-01T08:00:00Z”,“segmentation_type”:“GENDER”,“url”:null,“id_str”:“906196929771593729”,“entity_ids”:null,“end_time”:“2016-12-31T08:00:00Z”,“country”:null,“placement”:“ALL_ON_TWITTER”,“id”:906196929771593729,“expires_at”:null,“account_id”:“assmb”,“status”:“PROCESSING”,“granularity”:“DAY”,“entity”:“ACCOUNT”,“created_at”:“2017-09-08T16:45:59Z”,“platform”:null,“updated_at”:“2017-09-08T16:45:59Z”,“metric_groups”:[“BILLING”]}]}


Am trying to fetch Segment Stats for entity Account - Billing Metrics
#2

Billing is not available for ACCOUNT entity level:

You can check it here; https://dev.twitter.com/ads/analytics/metrics-and-segmentation


#3

Thanks Hector.
I missed that mapping earlier.

I tried for LINE_ITEMS as well
params.add(new HttpParameter(“granularity”, “DAY”));
params.add(new HttpParameter(“start_time”, “2014-03-11”));
params.add(new HttpParameter(“end_time”, “2014-03-18”));
params.add(new HttpParameter(“entity”,“LINE_ITEM”));
params.add(new HttpParameter(“entity_ids”, “14q4a”));
params.add(new HttpParameter(“metric_groups”,“BILLING”));
params.add(new HttpParameter(“placement”,“ALL_ON_TWITTER”));
params.add(new HttpParameter(“segmentation_type”,“GENDER”));

Got below status

JobStatus{“request”:{“params”:{“job_ids”:[906252524805472256]}},“next_cursor”:null,“data”:[]}

Could you please help with the same.


#4

Same output noticed for the entity PROMOTED_TWEET as well.
params.add(new HttpParameter(“granularity”, “DAY”));
params.add(new HttpParameter(“start_time”, “2017-06-15”));
params.add(new HttpParameter(“end_time”, “2017-06-30”));
params.add(new HttpParameter(“entity”,“PROMOTED_TWEET”));
params.add(new HttpParameter(“entity_ids”, “1ebn1e”));
params.add(new HttpParameter(“metric_groups”,“BILLING”));
params.add(new HttpParameter(“placement”,“ALL_ON_TWITTER”));
params.add(new HttpParameter(“segmentation_type”,“GENDER”));
String baseurl=“https://ads-api.twitter.com/2/stats/jobs/accounts/abcd”;

JobStatus{“request”:{“params”:{“job_ids”:[906261902619156480]}},“next_cursor”:null,“data”:[]}


#5

Hi @ajay_api,

Could you please provide the post request in twurl format?

If not, please provide it in cURL.

Which library are you using?

Thanks


#6

I think API access is not a problem here.
I just tried Segmented Stats for Campaign - Video metrics and I got that , But similar observation again , Its not available for LINTE_ITEM

JobStatus{“request”:{“params”:{“job_ids”:[906307825873305600]}},“next_cursor”:null,“data”:[]}

When I tried with Segmented stats for Engagement Metrics I got it for almost everything , But only for Billing and Video , I am not getting metrics for LINE_ITEM/PROMOTED_TWEET. If you think syntax could be wrong , Please provide twurl example and I can cross check the same.


#7

Similar observation noticed for MEDIA related metrics for LINE_ITEMS . Campaign works but LINE_ITEM , I just get blank job status.

JobStatus{“request”:{“params”:{“job_ids”:[906616650652295168]}},“next_cursor”:null,“data”:[]}


#8

Not sure if this means if source doesn’t have data for specific IDs / Date Range.


#9

@ajay_api: As @hector_borras suggested, you should provide the POST request using twurl.

In any case, here is an example:

$ twurl -X POST -H ads-api.twitter.com "/2/stats/jobs/accounts/awj1s?granularity=DAY&start_time=2014-03-11&end_time=2014-03-18&entity=LINE_ITEM&entity_ids=14q4a&metric_groups=BILLING&placement=ALL_ON_TWITTER&segmentation_type=GENDER"
{
  "request": {
    "params": {
      "start_time": "2014-03-11T07:00:00Z",
      "segmentation_type": "GENDER",
      "entity_ids": [
        "14q4a"
      ],
      "end_time": "2014-03-18T07:00:00Z",
      "placement": "ALL_ON_TWITTER",
      "granularity": "DAY",
      "entity": "LINE_ITEM",
      "metric_groups": [
        "BILLING"
      ]
    }
  },
  "data": {
    "start_time": "2014-03-11T07:00:00Z",
    "segmentation_type": "GENDER",
    "url": null,
    "id_str": "907686333371506688",
    "entity_ids": [
      "14q4a"
    ],
    "end_time": "2014-03-18T07:00:00Z",
    "country": null,
    "placement": "ALL_ON_TWITTER",
    "id": 907686333371506688,
    "expires_at": null,
    "account_id": "awj1s",
    "status": "PROCESSING",
    "granularity": "DAY",
    "entity": "LINE_ITEM",
    "created_at": "2017-09-12T19:24:20Z",
    "platform": null,
    "updated_at": "2017-09-12T19:24:20Z",
    "metric_groups": [
      "BILLING"
    ]
  }
}
$ twurl -H ads-api.twitter.com "/2/stats/jobs/accounts/awj1s?jobs_ids=907686333371506688"
{
  "request": {
    "params": {}
  },
  "next_cursor": null,
  "data": [
    {
      "start_time": "2014-03-11T07:00:00Z",
      "segmentation_type": "GENDER",
      "url": "https://ton.twimg.com/advertiser-api-async-analytics/BR8DrfsF465noH9qOes50CLvoztL6vwvvEfXT1gBSAOaF2i8253Uix65JdLYOWRgww7LdNVJCTLhEL5z5-roIgvwDefmyeeOsk5tlaGtwA-ixe-Pl2I5ZuwYoI-M0ARZ.json.gz",
      "id_str": "907686333371506688",
      "entity_ids": [
        "14q4a"
      ],
      "end_time": "2014-03-18T07:00:00Z",
      "country": null,
      "placement": "ALL_ON_TWITTER",
      "id": 907686333371506688,
      "expires_at": "2017-09-14T19:24:22Z",
      "account_id": "awj1s",
      "status": "SUCCESS",
      "granularity": "DAY",
      "entity": "LINE_ITEM",
      "created_at": "2017-09-12T19:24:20Z",
      "platform": null,
      "updated_at": "2017-09-12T19:24:22Z",
      "metric_groups": [
        "BILLING"
      ]
    }
  ]
}

url is not null.

Please let us know if this resolves the issue. If not, please provide the exact repro steps.