I can get campaign by Ads API, but I received 403 when create campaign

api

#1

I was successful to get the account ID and ID of funding instruments by Ads API.

used this endpoints:
https://ads-api.twitter.com/0/accounts
https://ads-api.twitter.com/0/accounts/18ce53xk1a7/funding_instruments

I was also confirmed authroity by this endpoint.
https://ads-api.twitter.com/0/accounts/18ce53xk1a7/authenticated_user_access

received response:
{“data_type”:“user_access”,“data”:{“user_id”:xxxxxxxx,“permissions”:[“AD_MANAGER”,“TWEET_COMPOSER”]},“request”:{“params”:{“account_id”:“18ce53xk1a7”}}}

But,I received 403 when create campaign by API.

My App ID:9097150

request:
curl --request ‘POST’ ‘https://ads-api.twitter.com/0/accounts/18ce53xk1a7/campaigns’ --data ‘daily_budget_amount_local_micro=1000000000&funding_instrument_id={my managed funding_instrument_id}&name=test&paused=true&start_time=2016-02-01T00%3A00%3A01Z’ --header ‘Authorization: OAuth oauth_consumer_key="{my key}", oauth_nonce="{my secret}", oauth_signature=“5kNPUPLxmMO1j1SJdjLNho20DL8%3D”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1453951375”, oauth_token="{my token}", oauth_version=“1.0”’

response:
{“errors”:[{“code”:“UNAUTHORIZED_CLIENT_APPLICATION”,“message”:“The client application making this request does not have access to this API”}],“request”:{“params”:{}}}

I think have the required authority.
Why I received 403?


#2

Could you please try using twurl? If you are still having issues when using twurl, please share the relevant request & response as per our Guidelines for Reporting Issues.

You can also make use of our officially supported SDKs.

You might also find this FAQ useful.


#3

Thanks. I tried again with twurl now.
But the same result.

step1. I installed twurl.

gem install twurl

step2. set up my account.

twurl authorize --consumer-key {my app key} --consumer-secret {my app secret} -u opt_tw_ope -p {my password}

result:
Authorization successful

step3. confirm authority.

request:
twurl /0/accounts/18ce53xk1a7/authenticated_user_access -H “ads-api.twitter.com

response:
{“data_type”:“user_access”,“data”:{“user_id”:2775874171,“permissions”:[“AD_MANAGER”,“TWEET_COMPOSER”]},“request”:{“params”:{“account_id”:“18ce53xk1a7”}}}

step4. I tried create campaign again with twurl.

request:
twurl /0/accounts/18ce53xk1a7/campaigns -X POST -d “daily_budget_amount_local_micro=1000000000&funding_instrument_id=klgb4&name=test&paused=true&start_time=2016-02-01T00%3A00%3A01Z” -H “ads-api.twitter.com

response:
{“errors”:[{“code”:“UNAUTHORIZED_CLIENT_APPLICATION”,“message”:“The client application making this request does not have access to this API”}],“request”:{“params”:{}}}

What is wrong with my try?


#4

@andrs

My received code is 403.
I do not know the reason for the lack of authority.


#5

Does following “Creating a Campaign - Step-by-Step” found here lead to the same problem for you?

I am wondering if you are dealing with the same issue as this user here?


#6

@andrs

Does following “Creating a Campaign - Step-by-Step” found here2 lead to the same problem for you?

I tried again in sandbox now. But the same result.

step1:

twurl -H ads-api-sandbox.twitter.com /0/accounts/

{“request”:{“params”:{}},“data”:[{“name”:“Sandbox account for @opt_tw_ope”,“timezone”:“America/Los_Angeles”,“timezone_switch_at”:null,“id”:“gq10k6”,“created_at”:“2016-01-29T16:07:17Z”,“salt”:“eee8563f4a7a47ca5436bbd8a4a0476a”,“updated_at”:“2016-01-29T16:07:17Z”,“approval_status”:“ACCEPTED”,“deleted”:false}],“data_type”:“account”,“total_count”:1,“next_cursor”:null}

twurl -H ads-api-sandbox.twitter.com /0/accounts/gq10k6/funding_instruments

{“request”:{“params”:{“account_id”:“gq10k6”}},“data”:[{“start_time”:“2016-01-29T16:07:17Z”,“description”:"(no payment method has been set up yet)",“credit_limit_local_micro”:0,“end_time”:null,“cancelled”:false,“id”:“hxhg9”,“paused”:false,“account_id”:“gq10k6”,“reasons_not_able_to_fund”:[],“currency”:“USD”,“funded_amount_local_micro”:0,“created_at”:“2016-01-29T16:07:17Z”,“type”:“CREDIT_CARD”,“able_to_fund”:true,“updated_at”:“2016-01-29T16:07:17Z”,“credit_remaining_local_micro”:null,“deleted”:false}],“data_type”:“funding_instrument”,“total_count”:1,“next_cursor”:null}

twurl -H ads-api-sandbox.twitter.com -d “start_time=2016-02-09T00:00:00Z&funding_instrument_id=hxhg9&name=My First Campaign&total_budget_amount_local_micro=500000000&daily_budget_amount_local_micro=50000000” /0/accounts/gq10k6/campaigns

{“errors”:[{“code”:“UNAUTHORIZED_CLIENT_APPLICATION”,“message”:“The client application making this request does not have access to this API”}],“request”:{“params”:{}}}

I am wondering if you are dealing with the same issue as this user here1?

My problem is I think different.
Read access was successfull.
But write access was failed.

Your link case is read access failed. He had not yet acquired the authority of the Ads API.
I have developer access already. I could to read the account information.

Why fail only writing?
My Application ID is ‘9097150’.
My application is already get the ‘Read and Write’ permissions.


#7

more my informations.

cat ~/.twurlrc

profiles:
opt_tw_ope:
lDWWPX0{sensitive data}:
username: opt_tw_ope
consumer_key: lDWWP{sensitive data}
consumer_secret: {sensitive data}
token: {sensitive data}
secret: {sensitive data}
configuration:
default_profile:

  • opt_tw_ope
  • lDWWPX0YR{sensitive data}

#8

From our docs on the Developer level:

Developer allows companies to begin creating a tool without any active advertisers. This level gives developers the ability to build out workflows using the Twitter Ads API before receiving full access. This access level will enable up to 5 oAuth Tokens and will restrict various API functionality and may be subject to additional limitations. Partners are strictly prohibited from creating, managing and/or reporting advertiser campaigns via the Twitter Ads API at Developer level.


#9

@andrs

Partners are strictly prohibited from creating, managing and/or reporting advertiser campaigns via the Twitter Ads API at Developer level.

I’m checking just to be sure.
That means I can not create a campaign with Ads API until get the basic level?


#10

@opt_tw_ope let me get back to you on the precise details on this once I confirm everything internally.


#11

@andrs

let me get back to you on the precise details on this once I confirm everything internally.

I’m looking forward to your reply. Thanks.


#12

@andrs

My problem has been resolved.
I received an explanation that was matter of internal permission settings from the account manager of japan.

Great thanks.


#13