Get /1/accounts not showing all account


#1

Hi,

I’m expecting that /1/accounts will return 2 json object, but instead it is returning only 1. If I individually query /1/accounts/:account_id for each of the 2 id I know it suppose to have, then I can see the data.

Weird enough, if I query /1/accounts I only get 1 json object… can someone help?

twurl -H ads-api.twitter.com ‘/1/accounts/18ce54ahyak’

 {
     "request": {
         "params": {
             "account_id": "18ce54ahyak"
         }
     },
     "data_type": "account",
     "data": {
         "name": "Allan Donald - Monster.com",
         "business_name": null,
         "timezone": "America\/New_York",
         "timezone_switch_at": "2016-02-24T05:00:00Z",
         "id": "18ce54ahyak",
         "created_at": "2016-02-24T09:16:44Z",
         "salt": "46df4eec0daa6f6e56d68179d3731f05",
         "updated_at": "2017-01-05T09:49:41Z",
         "business_id": null,
         "approval_status": "ACCEPTED",
         "deleted": false
     }
 }

twurl -H ads-api.twitter.com ‘/1/accounts/18ce54ffcgs’

 {
     "request": {
         "params": {
             "account_id": "18ce54ffcgs"
         }
     },
     "data_type": "account",
     "data": {
         "name": "Monster Social Job Ads (3) for Monster QA Handle (@Monstersjqa3)",
         "business_name": null,
         "timezone": "America\/New_York",
         "timezone_switch_at": "2013-05-22T04:00:00Z",
         "id": "18ce54ffcgs",
         "created_at": "2016-11-28T22:00:49Z",
         "salt": "2875f64bc1640f9420e5adab1a9dbef1",
         "updated_at": "2016-11-28T22:01:25Z",
         "business_id": null,
         "approval_status": "ACCEPTED",
         "deleted": false
     }
 }

twurl -H ads-api.twitter.com ‘/1/accounts?with_deleted=false’

 {
     "request": {
         "params": {
             "with_deleted": false
         }
     },
     "data": [{
         "name": "Allan Donald - Monster.com",
         "business_name": null,
         "timezone": "America\/New_York",
         "timezone_switch_at": "2016-02-24T05:00:00Z",
         "id": "18ce54ahyak",
         "created_at": "2016-02-24T09:16:44Z",
         "salt": "46df4eec0daa6f6e56d68179d3731f05",
         "updated_at": "2017-01-05T09:49:41Z",
         "business_id": null,
         "approval_status": "ACCEPTED",
         "deleted": false
     }],
     "data_type": "account",
     "total_count": 1,
     "next_cursor": null
 }

#2

@aminmonster703: We’re seeing both accounts when making a request to the GET accounts endpoint. What do you see with the following?

$ twurl accounts

Have you authorized multiple client apps? If so, which is the default one?


#3

@juanshishido : the 2nd account was created by Twitter for our account. It is having the same token/secret as 18ce54ahyak. I assume having token/secret means that this account is already authenticated for the application we using (we only have 1 application, and as such same consumer key and secret).

I believe if I try to authenticate again, then the token will change and it will affect our production and testing environment. I may be wrong, but if possible I dont want to go and authenticate again, since I can already make a get request for both specific account using the same token/secret and consumer key/consumer secret, in fear of breaking things…

Here is .twurlrc file content

monstersjqa3:
kB:
username: monstersjqa3
consumer_key: k
B
consumer_secret: 13
token: 772368-

secret: P**

Here is the output of twurl accounts command as requested

Monster
kB
monstersjqa3
k
B (default)

From below link, this is a user context request, so supplying the token/secret for 18ce54ahyak, and I should be getting 2 result right (since both account is sharing the same token/secret)?

I ran twurl -H ads-api.twitter.com ‘/1/accounts/’ and I’m still seeing only 1 count. Not sure how you get 2 account using those… am I doing wrong here?

BTW, we have .NET application, and running test case for this endpoint with same token/secret also gives me 1 account only, so twurl and .NET is giving me same result…

https://dev.twitter.com/ads/reference/get/accounts


#4

This is correct. You should be seeing two results. However, what’s curious is that the token listed above doesn’t seem to be for monstersjqa3 (18ce54ahyak or 18ce54ffcgs); it’s for a different handle. Perhaps you were authenticated (signed in to Twitter) as that other handle when setting up twurl (after the $ twurl authorize --consumer-key key --consumer-secret secret step)?


#5

@aminmonster703: what happens when you try to make the following request?

twurl -H ads-api.twitter.com "/1/accounts/18ce54ffcgs/campaigns"

#6

Sorry there, I was using my home PC, and I mistakenly taken the production account Monster (18ce53ymmtp)…

monstersjqa3:
kB:
username: monstersjqa3
consumer_key: k
B
consumer_secret: 1**3
token: 702402412854771712-4
secret: E
X

running

twurl -H ads-api.twitter.com “/1/accounts/18ce54ffcgs/campaigns”

{
    "request": {
        "params": {
            "account_id": "18ce54ffcgs"
        }
    },
    "data": [],
    "data_type": "campaign",
    "total_count": 0,
    "next_cursor": null
}

While running twurl -H ads-api.twitter.com “/1/accounts/18ce53ahyak/campaigns” will return lots of campaign. I think this is expected behaviour. I dont want to be seeing campaign created on 18ce54ffcgs appearing in 18ce53ahyak and vice versa…

For good measure, I ensure that I’m using monstersjqa3 account again, and run below command, still it is 1 account returned only…

twurl -H ads-api.twitter.com ‘/1/accounts?with_deleted=true’

Sorry for misleading you in previous post… I’m very curious how you can get 2 result whereby I only getting 1 result…


#7

Thanks for the response, @aminmonster703. Unfortunately, we haven’t been able to reproduce this issue. Thus, we’re not able to determine why you’re only seeing one account.