User XXXX is not authorized to create tweets for user id YYYYY


#1

Hi all,

I am trying to post a Promoted tweet into another accounts Campaign as part of some dynamic setup configuration.

I believe I have setup the correct permissions but maybe I am doing something wrong. I have looked at the help and some other messages on here but still getting the same error. Here is what I’ve done so far.

I have two accounts the “app” and a “target”

The app18ce549rjnj” has been granted Ads Manager Access to the “targetaccount18ce53zy2tx”. The checkbox “Create Promotable Tweets” is also checked.

When I run the following in Postman:
https://ads-api.twitter.com/1/accounts/18ce549rjnj/promotable_users

I get this:

When I run the following in Postman:
https://ads-api.twitter.com/1/accounts/18ce53zy2tx/promotable_users

I get this:

As I understand it, I need to pass in the “as_user_id” parameter when executing the following:

https://ads-api.twitter.com/1/accounts/18ce549rjnj/tweet/?status=TESTING_123&as_user_id=38906681

Yet when I do this, I get the following error:

Any help would be much appreciated!

Thanks.


User X is not authorized to create tweets for user id Y
#2

Hi, @SocialOpinions. Thanks for your question and for providing all of these details.

Your understanding is correct—you do need to use the as_user_id parameter when creating a promoted-only tweet for 18ce53zy2tx. However, you must also specify this user’s account ID (instead of 18ce549rjnj) in your request, as shown below:

$ twurl -X POST -H ads-api.twitter.com "/1/accounts/18ce53zy2tx/tweet?status=TESTING_123&as_user_id=38906681"

The account ID used in Ads API endpoints should belong to the account you’re managing.

Hope this clears things up. Please let us know if this resolves the issue. Thanks!


Error NotAuthorized creating promoted tweets
Modify campaign via API
#3

Thanks @juanshishido ! That done the trick when I tested in Postman, now need to try the same in my app!


#4

@juanshishido - Integrated this into Social Opinion and working as expected! Thanks again! :slight_smile:


#5

Great to hear, @SocialOpinions!