Hi,
I have created a custom PHP library(using PHP cURL) and it working fine for Ads API with GET method. When trying with POST method then getting below response.
Response : {“errors”:[{“code”:“UNAUTHORIZED_ACCESS”,“message”:“This request is not properly authenticated”}],“request”:{“params”:{}}}
Header Information for request
POST /1/stats/jobs/accounts/{account_id} HTTP/1.1
Host: ads-api.twitter.com
Accept: */*
Authorization: OAuth oauth_consumer_key="{oauth_consumer_key}",oauth_nonce="1494845304", oauth_signature="CCkH3%2F6VhEcuHVobCVpjRqTu6T4%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1494845304", oauth_token="{oauth_token}", oauth_version="1.0"
Content-Length: 179
Content-Type: application/x-www-form-urlencoded
Could anyone help me to figure out the issue?
OR
Do you have another endpoint instead of below endpoint, Please share
POST /1/stats/jobs/accounts/:account_id
============================================================
I have also tried like below
1.
POST /1/stats/jobs/accounts/{account_id} HTTP/1.1
Host: ads-api.twitter.com
Accept: */*
Authorization: OAuth end_time="2017-04-25", entity="CAMPAIGN", entity_ids="xxxxx", granularity="TOTAL", metric_groups="ENGAGEMENT", oauth_consumer_key="{oauth_consumer_key}", oauth_nonce="1494848118", oauth_signature="bPczRqTptu9%2FzzYm3SrjM7nG4b8%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1494848118", oauth_token="{oauth_token}", oauth_version="1.0", placement="ALL_ON_TWITTER", platform="0", segmentation_type="DEVICES", start_time="2017-04-24"
Content-Length: 179
Content-Type: application/x-www-form-urlencoded
2.
POST /1/stats/jobs/accounts/{account_id}?end_time=2017-04-25&entity=CAMPAIGN&entity_ids=86onf&granularity=TOTAL&metric_groups=ENGAGEMENT&placement=ALL_ON_TWITTER&start_time=2017-04-24&segmentation_type=DEVICES&platform=0 HTTP/1.1
Host: ads-api.twitter.com
Accept: */*
Authorization: OAuth end_time="2017-04-25", entity="CAMPAIGN", entity_ids="xxxxx", granularity="TOTAL", metric_groups="ENGAGEMENT", oauth_consumer_key="{oauth_consumer_key}", oauth_nonce="1494848461", oauth_signature="OHTBboE%2BSnTbDbTJQdfDbrXQCI4%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1494848461", oauth_token="{oauth_token}", oauth_version="1.0", placement="ALL_ON_TWITTER", platform="0", segmentation_type="DEVICES", start_time="2017-04-24"
Content-Length: 179
Content-Type: application/x-www-form-urlencoded