I have a Twitter APP witch is granted access to Twitter Ads API.
If I use twurl
or php curl, I can GET informations from the Ads API.
I am trying to run a POST in the sandbox API in order to create an account.
If I run the provided API trough twurl this is what I get:
twurl -t -H "ads-api-sandbox.twitter.com" "/5/accounts" | jq
opening connection to ads-api-sandbox.twitter.com:443...
opened
starting SSL for ads-api-sandbox.twitter.com:443...
SSL established
<- "GET /5/accounts HTTP/1.1\r\nAccept-Encoding:
...
read 79 bytes
Conn close
{
"request": {
"params": {}
},
"next_cursor": null,
"data": []
}
This is a GET response. It shows nothing because there is no an account created in the sandbox.
If run with a php (Laravel 5.7) code this is what I GET:
{#712 ▼
+"request": {#678 ▼
+"params": {#627}
}
+"next_cursor": null
+"data": []
}
If I run a POST from the same PHP,
{#678 ▼
+"errors": array:1 [▼
0 => {#627 ▼
+"code": "UNAUTHORIZED_ACCESS"
+"message": "This request is not properly authenticated"
}
]
+"request": {#714 ▼
+"params": {#712}
}
}
If I try to get informations from the production Ads Twitter API, I can see all the expected data.
That means that I do have access to the API, at least for GET, but I cant create an account in the sandbox OR I cant run a POST request.
I couldn't find any documentation showing how to solve this issue. Only this post without solution.
Any idea?