Twitter API GET accounts call return empty data


#1

Hi,

The following account id return empty data from Twitter (API call -> https://ads-api.twitter.com/2/accounts)
but I’m getting the result (https://ads-api.twitter.com/2/accounts/18ce548aii3 )
Please refer below.

  1. 18ce548aii3

C: \ Ruby23 > twurl - H ads-api.twitter.com/2/accounts

{
	"request": {
		"params": {}
	},
	"next_cursor": null,
	"data": []
}

C: \ Ruby23 > twurl - H ads-api.twitter.com/2/accounts/18ce548aii3

{
	"request": {
		"params": {
			"account_id": "18ce548aii3"
		}
	},
	"data": {
		"name": "@**XX",
		"business_name": null,
		"timezone": "America\/Los_Angeles",
		"timezone_switch_at": "2013-05-22T07:00:00Z",
		"id": "
		18ce548aii3",
		"created_at": "2015-11-25T02:18:42Z",
		"salt": "7*XXX908c3",
		"updated_at": "2016-02-29T17:09:02Z",
		"business_id": null,
		"approval_status": "ACCEPTED",
		"deleted": false
	}
}
  1. 18ce53uosa3

C: \ Ruby23 > twurl - H ads-api.twitter.com/2/accounts

{
	"request": {
		"params": {}
	},
	"next_cursor": null,
	"data": []
}

C: \ Ruby23 > twurl - H ads-api.twitter.com/2/accounts/18ce53uosa3

{
	"request": {
		"params": {
			"account_id": "18ce53uosa3"
		}
	},
	"data": {
		"name": "Jos***",
		"business_name": null,
		"timezone": "America\/New_York",
		"timezone_switch_at": "2014-02-23T05:00:00Z",
		"id": "18ce53uosa3",
		"creat
		ed_at": "2013-10-17T14:40:06Z",
		"salt": "4********ere",
		"updated_at": "2017-07-18T19:03:04Z",
		"business_id": null,
		"approval_status": "ACCEPTED",
		"deleted": false
	}
}

Thanks,
Sala


Get Accounts not return multiple Ac Account
#2

Thanks for the question, @Salashah.

The first request should return all accounts that the authenticated user has access to. Let us take a look at what could be going on.


#3

Hi @juanshishido,

Any updates?

Thanks,


#4

@Salashah: Could you please make the request using the -t flag? Trying to determine who you’re authenticated as.


#5

Hi

Below result using -t flag. I set XXXX for all the keys.

C:\ Ruby23 > twurl - t ads - api.twitter.com / 2 / accounts /

opening connection to api.twitter.com: 443…
opened
starting SSL for api.twitter.com: 443…
SSL established
< - “GET /2/accounts/ HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: /\r\nUser-Agent: OAuth gem v0.5.1\r\nContent-Type: application/x-www-form-urlencoded\r\nAuthoriza
tion: OAuth oauth_consumer_key=“XXXXXXXXX”, oauth_nonce=“XXXXXXXXXX”, oauth_signature=“wt2MZy%XXXXXXX%3D”, oauth_signature_method=
” HMAC - SHA1 \ “, oauth_timestamp=“1513302684”, oauth_token=“48786099-XXXXXXXXXXXX”, oauth_version=“1.0”\r\nConnection: close\r\nHost: api.twitter.com\r\nContent-Length:
0\r\n\r\n”
< - “”
->“HTTP/1.1 404 Not Found\r\n”
->“connection: close\r\n”
->“content-encoding: gzip\r\n”
->“content-length: 1742\r\n”
->“content-security-policy: default-src ‘none’; img-src https://abs.twimg.com https://ssl.google-analytics.com http://www.google-analytics.com; script-src https://abs.twimg.com https://ssl.google-ana
lytics.com https://ajax.googleapis.com http://www.google-analytics.com about:; style-src https://abs.twimg.com https://fonts.googleapis.com ‘unsafe-inline’; font-src https://abs.twimg.com https://twit
ter.com; connect-src ‘none’; object-src ‘none’; media-src ‘none’; frame-src ‘none’; report-uri https://twitter.com/i/csp_report?a=ORTGK%3D%3D%3D&ro=false\r\n
->“content-type: text/html;charset=utf-8\r\n”
->“date: Fri, 15 Dec 2017 01:51:26 GMT\r\n”
->“server: tsa_k\r\n”
->“set-cookie: personalization_id=“v1_l+XXXXXXXXX==”; Expires=Sun, 15 Dec 2019 01:51:26 UTC; Path=/; Domain=.twitter.com\r\n”
->“set-cookie: guest_id=v1%XXXXXXXXXXXXXXX; Expires=Sun, 15 Dec 2019 01:51:26 UTC; Path=/; Domain=.twitter.com\r\n”
->“strict-transport-security: max-age=631138519\r\n”
->“x-connection-hash: XXXXXXXXXXXXXXXXXXXXXXXXX\r\n”
->“x-rate-limit-limit: 15\r\n”
->“x-rate-limit-remaining: 14\r\n”
->“x-rate-limit-reset: 1513303586\r\n”
->“x-response-time: 175\r\n”
->“x-xss-protection: 1; mode=block\r\n”
->"\r\n"
reading 1742 bytes…
->""
->"\x1F\x8B\b\x00\x00\x00\x00\x00\x00\x00\x94\x99\xCDo\x1C\xB7\x15\xC0\xEF\xF9+\x98)\x90\4;ZY\xB2\xBC\xF1\xEE6\xAD\xE3\xC2A\x93\xD4\xA8\xD5\x029\x05\x9C\x19j\x87\x11\x97\x1C\x93\x9C\xFD\xE8Ij\x02\x0
4\b\xECC\xD0:F\x00\xA3\xB0\xDD\xB5\xEC\xC8\x8E\xAA\xC8\x0E"\xC9\xB1}\x90{\x15F\x97XF/\x93"p?\xD0\xFE\x0F%wv\xD5\xDD\xD5.-B\xC0\xEC\x90\xF3\xF8\xE3\xE3{\x8F\x8F3O\xE5W\xDF\xFA\xD5\x99\x85\xF7\xCF\x9F
\x05\x91\xAC\x93\xEA+e\xFD\x03ZuBE\xC5\x89\xA4\x8C\xDF\xF0\xBCf\xB3Yh\x9E(0^\xF3\x8A\xA5R\xC9ki\x19\a\x10Hk\x15\aQG\x8B\xBFq\xD8\xAA\xBE\x02@9B0\xD47\xEA\xB6\x8E$\x04\x9A\xE4\xA2\x8B\tnT\x9C3\x8CJD\xA
5\xBB\xD0\x8E\x91\x03\x82\xBCUq$jIO\x93O\x83 \x82\ YI\xE4\xA2{\xCAy\x19\xE7\x1D5s\x02k\x83,D\xDDD\f\r\xA4\xB0\x8E*\x0Eg>\x93b@\x902LC\xD4\x9A\x02\x94-2BXs\xCC\xA0\x06F\xCD\x98q90\xAC\x89C\x19UB\xD4\x
C0\x01r\xBB\x8D)\x80)\x96\x18\x12W\x04\x90\xA0J\xB10\xDDGI,\t\xAA.4\xB1\x94\x88\x03\x0F\xFC\xB4\xEC\xE5]\xF9c\x82\xE9\x12\x888Z\xCC\xED-\x94\xC1\xA1/\n\xB2\x89\xEB\xB5B\xC0\xEA\xDE"T\xD30*\xFA7\x05uq
\x00G\xA4\xE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xB0\xFB\x1D_\xDA\xBD\x8D,\x91\x89!\x16\xD2?\xA7;\xCAo\e\xFBW\xD3G*\xD8.)\xEFm\x80\xF4\xBB\xF4q\xBA\x99nX\xCE\xD30\x1C\xE7\v\xF8\x87\x9D’\xEAS\xFE\xB7\x
F8\x87\x87\x9FHK\xF0\xEF"70\x9C\x13\xFFX_\xFE\xF1\xD1\x1F~\xDC\xFA\xEA\xC5\xE7\x9F\xD8\x93e\xD3@\xDE^\xF9\xD7\xDD?\x1A\xC8\xA3\xD5\x9A\xF2\x91\xE2\r\xC1\xE0\x10\}-q\xFBt\xBF\xC2\x01\xCA\xEA\xF5\x99 v?\xBFu\x7F\xB7\x1A\xE5\xB6\x11\xEC\xD6\xBA\xF4\xA31\x05\xA2\xB1\x15'\xE8\xB3D\x16\x06\x8B\x13N\xF5g\xBAo|\x91i,C$\xB1.=\x8FP\xCE!\x12\x833\x88\xF6\xEA1\xC7i\x94\x842\x11#\xA4\v\xDD\xCEq\x90a\e\x1E\x
A7\x9A%\x02\x8Ecy\x8Cz\xE2\xEC\xF4\xAC[\x9C\x9F\x85\xC5\xC5"\x9C-\xCE\x9E\x9C\xF3O\xA1y\x7Ffz\x0E\x95\xE6\xE6\x8A\xA5\xD2\xDC\xCC\xC9\xF9\xC2\x87\xA2k\xEF.3\xAF&\xE7E\xE4\xB2\x97\xFF\xA3\xE2\x7F\x00
x00\x00\xFF\xFF\x03\x00\r\xF6\n\xF6\xB9\x18\x00\x00"
< !DOCTYPE html >
< html xmlns = “http://www.w3.org/1999/xhtml” lang = “en” xml: lang = “en” >
< head >
< meta http - equiv = “Content-Type” content = “text/html; charset=utf-8” >
< meta http - equiv = “Content-Language” content = “en-us” >
< meta name = “robots” content = “noindex, nofollow” >
< meta name = “viewport” content = “width=device-width, initial-scale=1.0” >
< title > Twitter / ? < / title >
< link href = “https://abs.twimg.com/favicons/favicon.ico” rel = “shortcut icon” type = “image/x-icon” >
< link rel = “stylesheet” href = “https://abs.twimg.com/errors/fullscreen_errors-4e29aecc89be6d500979e19c3bd72aa2.css” >
< / head >
< body >
< div class = “errorpage-topbar” >
< div class = “errorpage-global-nav” >
< div class = “errorpage-global-nav-inner” >
< div class = “errorpage-container” >
< ul class = “errorpage-nav” >
< li >
< a href = “https://twitter.com” > < img class = “errorpage-bird” srcset = ‘https://abs.twimg.com/errors/logo23x19.png 1x, https://abs.twimg.com/errors/logo23x19@2x.png 2x’ src = “https://abs.twim
g.com/errors/logo23x19.png” alt = “Twitter” > < / a >
< / li >
< / ul >
< div class = “errorpage-pull-right” >
< ul class = “errorpage-nav” >
< li > < a href = “https://twitter.com” id = “homeLink” > Home & rarr;
< / a > < / li >
< / ul >
< / div >
< / div >
< / div >
< / div >
< / div >
< div >
< div class = “errorpage-body-content” >

 < h1 > Sorry, that page doesn 't exist!</h1>
      <p>You can <a href="https://twitter.com/search-home">search Twitter</a> using the search box below or <a href="https://twitter.com">return to the homepage</a>.</p>
      <form class="search-404" action="https://twitter.com/search" method="get">
        <input id="search_q" name="q" type="text" aria-label="Search query" placeholder="Search for a topic, full name, or @username">
        <input class="errorpage-btn" id="search_submit" type="submit" value="Search">
      </form>

    <div class="errorpage-footer">
      <ul class="errorpage-languages">

          <li><a data-language="ar" data-dir="rtl" href="#">???????</a></li>

          <li><a data-language="bg" data-dir="ltr" href="#">????????? ????</a></li>

          <li><a data-language="bn" data-dir="ltr" href="#">?????</a></li>

          <li><a data-language="ca" data-dir="ltr" href="#">Català</a></li>

          <li><a data-language="cs" data-dir="ltr" href="#">Cestina</a></li>

          <li><a data-language="da" data-dir="ltr" href="#">Dansk</a></li>

          <li><a data-language="de" data-dir="ltr" href="#">Deutsch</a></li>

          <li><a data-language="el" data-dir="ltr" href="#">ε???????</a></li>

          <li><a data-language="en" data-dir="" href="#">English</a></li>

          <li><a data-language="en-gb" data-dir="ltr" href="#">English UK</a></li>

          <li><a data-language="es" data-dir="ltr" href="#">Español</a></li>

          <li><a data-language="fa" data-dir="rtl" href="#">?????</a></li>

          <li><a data-language="fi" data-dir="ltr" href="#">Suomi</a></li>

          <li><a data-language="fil" data-dir="ltr" href="#">Filipino</a></li>

          <li><a data-language="fr" data-dir="ltr" href="#">Français</a></li>

          <li><a data-language="gu" data-dir="ltr" href="#">???????</a></li>

          <li><a data-language="he" data-dir="rtl" href="#">????????</a></li>

          <li><a data-language="hi" data-dir="ltr" href="#">??????</a></li>

          <li><a data-language="hr" data-dir="ltr" href="#">Hrvatski</a></li>

          <li><a data-language="hu" data-dir="ltr" href="#">Magyar</a></li>

          <li><a data-language="id" data-dir="ltr" href="#">Bahasa Indonesia</a></li>

          <li><a data-language="it" data-dir="ltr" href="#">Italiano</a></li>

          <li><a data-language="ja" data-dir="ltr" href="#">???</a></li>

          <li><a data-language="kn" data-dir="ltr" href="#">?????</a></li>

          <li><a data-language="ko" data-dir="ltr" href="#">???</a></li>

          <li><a data-language="mr" data-dir="ltr" href="#">?????</a></li>

          <li><a data-language="msa" data-dir="ltr" href="#">Bahasa Melayu</a></li>

          <li><a data-language="nl" data-dir="ltr" href="#">Nederlands</a></li>

          <li><a data-language="no" data-dir="ltr" href="#">Norsk</a></li>

          <li><a data-language="pl" data-dir="ltr" href="#">Polski</a></li>

          <li><a data-language="pt" data-dir="ltr" href="#">Português</a></li>

          <li><a data-language="ro" data-dir="ltr" href="#">Româna</a></li>

          <li><a data-language="ru" data-dir="ltr" href="#">???????</a></li>

          <li><a data-language="sk" data-dir="ltr" href="#">Slovencina</a></li>

          <li><a data-language="sr" data-dir="ltr" href="#">??????</a></li>

          <li><a data-language="sv" data-dir="ltr" href="#">Svenska</a></li>

          <li><a data-language="ta" data-dir="ltr" href="#">?????</a></li>

          <li><a data-language="th" data-dir="ltr" href="#">???????</a></li>

          <li><a data-language="tr" data-dir="ltr" href="#">Türkçe</a></li>

          <li><a data-language="uk" data-dir="ltr" href="#">?????????? ????</a></li>

          <li><a data-language="vi" data-dir="ltr" href="#">Ti?ng Vi?t</a></li>

          <li><a data-language="zh-cn" data-dir="ltr" href="#">????</a></li>

          <li><a data-language="zh-tw" data-dir="ltr" href="#">????</a></li>

      </ul>
      <ul>
        <li dir="ltr">&copy; Twitter <span id="copyright-year"></span></li>
        <li><a href="https://about.twitter.com/">About</a></li>
        <li><a href="https://support.twitter.com/">Help Center</a></li>
        <li><a href="http://status.twitter.com/">Status</a></li>
      </ul>
    </div>
  </div>
</div>
<script src="https://abs.twimg.com/errors/404-174a1f1a41465b8e7b205e9551995267.js"></script>
read 1742 bytes Conn close

#6

Looks like you’re making a request to api.twitter.com and you’re getting a 404. Please fix this.


#7

Hi,

Please refer below.

C:\Ruby23>twurl -H ‘ads-api.twitter.com’ “/2/accounts/” -t
opening connection to ads-api.twitter.com:443
opened
starting SSL for ads-api.twitter.com:443
SSL established
<- “GET /2/accounts/ HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: /\r\nUser-Agent: OAuth gem v0.5.1\r\nContent-Type: application/x-www-form-urlencoded\r\nAuthoriza
tion: OAuth oauth_consumer_key=“XXXXXXXXXXXX”, oauth_nonce=“XXXXXXXXXXXXXXXXXXXXXXX”, oauth_signature=“XXXXXXXXXXXXXXXXXXXXXXXXX%3D”, oauth_signature_method=“HM
AC-SHA1”, oauth_timestamp=“1513319959”, oauth_token=“48786099-XXXXXXXXXX”, oauth_version=“1.0”\r\nConnection: close\r\nHost: ads-api.twitter.com\r\nContent-Length
: 0\r\n\r\n”
<- “”
-> “HTTP/1.1 200 OK\r\n”
-> “connection: close\r\n”
-> “content-disposition: attachment; filename=json.json\r\n”
-> “content-encoding: gzip\r\n”
-> “content-length: 79\r\n”
-> “content-type: application/json;charset=utf-8\r\n”
-> “date: Fri, 15 Dec 2017 06:39:20 GMT\r\n”
-> “server: tsa_a\r\n”
-> “set-cookie: personalization_id=“v1_XXXXXXXXXXXXGIlSnEmA==”; Expires=Sun, 15 Dec 2019 06:39:20 UTC; Path=/; Domain=.twitter.com\r\n”
-> “set-cookie: guest_id=v1%3A15XXXXXXXX8; Expires=Sun, 15 Dec 2019 06:39:20 UTC; Path=/; Domain=.twitter.com\r\n”
-> “strict-transport-security: max-age=631138519\r\n”
-> “x-access-level: read-write\r\n”
-> “x-api-version: 2.0\r\n”
-> “x-connection-hash: XXXXXXXXXX\r\n”
-> “x-content-type-options: nosniff\r\n”
-> “x-current-api-version: 2.0\r\n”
-> “x-frame-options: SAMEORIGIN\r\n”
-> “x-rate-limit-limit: 2000\r\n”
-> “x-rate-limit-remaining: 1998\r\n”
-> “x-rate-limit-reset: 1513320629\r\n”
-> “x-response-time: 18\r\n”
-> “x-runtime: 0.007164\r\n”
-> “x-transaction: 00761f920040022d\r\n”
-> “x-xss-protection: 1; mode=block\r\n”
-> "\r\n"
reading 79 bytes…
-> “”
-> “\x1F\x8B\b\x00\x00\x00\x00\x00\x00\x00\xAAVJ-,M-.Q\xB2\xAAVH,J\xCC-\x06\xB2jku\x94\xF2R+J\xE2\x93K\x8B\x8A\xF3\x8B\x94\xAC\xF2Jsrt\x94R\x12K\x12\x95\xAC\xA2ck\x01\x00\x00\x00\xFF\xFF\x03\x00\xC4
\x1C\x06\xEC6\x00\x00\x00”
{“request”:{“params”:{}},“next_cursor”:null,“data”:[]}read 79 bytes
Conn close

Thanks,
Sala


#8

Thanks for this information.

It looks like the user you’re authenticated as only has access to a single ads account: 18ce53uosa3. This means you should not see information for the 18ce548aii3 ads account. Are you using different authentication credentials for each request? (This is common practice.)

That being said, it’s not clear why you’re not seeing data when you make the request, though.


#9

Hi @juanshishido.

Actually, both accounts from different Twitter handles, I just provide the examples above from 2 different users.
I’m thinking maybe both accounts not created under my app id. but I have 1 more case which is confirmed account created under my app ID. it’s returning only 1 account when I call GET accounts.

Please refer below thread

Thanks,
Sala


#10

Added trace info for that account

C:\Ruby23>twurl -H ‘ads-api.twitter.com’ “/2/accounts/” -t
opening connection to ads-api.twitter.com:443
opened
starting SSL for ads-api.twitter.com:443
SSL established
<- “GET /2/accounts/ HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: /\r\nUser-Agent: OAuth gem v0.5.1\r\nContent-Type: application/x-www-form-urlencoded\r\nAuthoriza
tion: OAuth oauth_consumer_key=“XXXXXXXXXXXXXXX”, oauth_nonce=“XXXXXXXXXXXXXXXX”, oauth_signature=“XXXXXXXXXXXXXX%3D”, oauth_signature_method=“
HMAC-SHA1”, oauth_timestamp=“1513327954”, oauth_token=“702402412854771712-XXXXXXXXXX”, oauth_version=“1.0”\r\nConnection: close\r\nHost: ads-api.twitter.com\r\nContent-Leng
th: 0\r\n\r\n”
<- “”
-> “HTTP/1.1 200 OK\r\n”
-> “connection: close\r\n”
-> “content-disposition: attachment; filename=json.json\r\n”
-> “content-encoding: gzip\r\n”
-> “content-length: 289\r\n”
-> “content-type: application/json;charset=utf-8\r\n”
-> “date: Fri, 15 Dec 2017 08:52:35 GMT\r\n”
-> “server: tsa_a\r\n”
-> “set-cookie: personalization_id=“v1_IXXXXXXX+XXXXXXXX==”; Expires=Sun, 15 Dec 2019 08:52:35 UTC; Path=/; Domain=.twitter.com\r\n”
-> “set-cookie: guest_id=v1%XXXXXXXXXXXX; Expires=Sun, 15 Dec 2019 08:52:35 UTC; Path=/; Domain=.twitter.com\r\n”
-> “strict-transport-security: max-age=631138519\r\n”
-> “x-access-level: read-write\r\n”
-> “x-api-version: 2.0\r\n”
-> “x-connection-hash: XXXXXXXXXXXXXXXX\r\n”
-> “x-content-type-options: nosniff\r\n”
-> “x-current-api-version: 2.0\r\n”
-> “x-frame-options: SAMEORIGIN\r\n”
-> “x-rate-limit-limit: 2000\r\n”
-> “x-rate-limit-remaining: 1969\r\n”
-> “x-rate-limit-reset: 1513328706\r\n”
-> “x-response-time: 20\r\n”
-> “x-runtime: 0.010386\r\n”
-> “x-transaction: 005e9603005b77cd\r\n”
-> “x-xss-protection: 1; mode=block\r\n”
-> "\r\n"
reading 289 bytes…
-> “”
-> “\x1F\x8B\b\x00\x00\x00\x00\x00\x00\x00d\x8F\xCDN\xC30\x10\x84_\xA5\xDAs\x02N\x9A8\xADo\xA8\xED\x11\xC4\xA1\x17\xFE\x14-\xF6F\x8Dp\xEC`;\x14\xA8\xF2\xEE8\x8D\x04\xAA\x90\xF6\xB0\xD2|3\x9A9\x81\xA3
xF7\x81|\x00q\x82\x1E\x1Dv>~\xE3\x98\x80\xA1\xCFP\xCB\xC1y\xEB@\x98A\xEB\x04\x14\x06\x04\xF1t\x02\x83\x1D\x81\x80\e\xAD\xD1,\xB6\xD6\xA0V\x8Btqk\x8D\x0F\xE4\xAE\xA4\xED \x81\xD7\xC1\xB7\x86\xBC\xAFgxN
\bmG\xDF\xD6\x9C\xCD\x1D\xB9V\xE2\xF3\xF5\x1D\x1D\xEB\a\xEB\xDE\xE0O\xAE\xFD\xB1\r\xF2Pc\xAC\x059\xCBx\xCA\xF24/\xF6\xAC\x14\x8C\xC5{\x8Cl\xAB\xA2\x96\xAD$\x95\x05\x1E\xBEp\xB2KG\x18H\xFD\xB7\xADE\xC6
EQL6\x8FzR\v\xAE\x9A\x82H2\x85\xC8\eN%W|\x95Uk\xB5\xAC\x96Y\xC3\xCAH\x0E\xBD\xBAH\xAB\xD2,OYu.\xB1\x16\xF9\xB9\xC4\xEF\xC8\xA9\xCD<\x11\xFB\xDE\xD9\x0F\xD4\xB5\x0F\x18\x06?-\xDDlv\xF7\xFB\xDD6\xF2\x8A
4\xC5L\x10\rjO\xE3\xCB\xF8\x03\x00\x00\xFF\xFF\x03\x00\xAA\x9E\xAF\x8D\x80\x01\x00\x00”
{“request”:{“params”:{}},“next_cursor”:null,“data”:[{“name”:“Allan Donald - XXXXX.com”,“business_name”:null,“timezone”:“America/New_York”,“timezone_switch_at”:“2016-02-24T05:00:00Z”,“id”:“18ce54ahy
ak”,“created_at”:“2016-02-24T09:16:44Z”,“salt”:“XXXXXXx”,“updated_at”:“2017-12-07T05:09:20Z”,“business_id”:null,“approval_status”:“ACCEPTED”,“deleted”:false}]}read 289 bytes
Conn close


#11

Ads accounts are independent of the app. Ads account abc123, for example, which, let’s suppose, belongs to user @juanshishido, can be used with any app the user authenticates with.


In the other thread, you asked, “Do you have API calls to get all accounts on the same token?” Most ads entities have two endpoints to retrieve information. For accounts, we have GET accounts and GET accounts/:account_id. The first retrieves information on all ads account; the second, retrieves information for the specified account only.


#12

Hi

Twitter has some issue with PMFI callback URL, I created the different thread for that. so the above case after the user authenticates was stopped until getting OAuth secret and token, so I thought the account (PMFI) was not created.

GET accounts is not retrieved all ads accounts here.

Thanks,


#13

@Salashah: Has this issue been resolved?


#14

No @juanshishido

GET accounts is not retrieved all ads accounts. Only retrieved 1 account if I use multiple ad accounts.


#15

@juanshishido I have a Twitter account created in 2012, which has one Ad account. I see the same issue. No Ad accounts are displayed in this API request. Need help!