Error ROUTE_NOT_FOUND


#1

https://dev.twitter.com/ads/reference/get/targeting_criteria/app_store_categories

Hi all, could you try to replicate this error?

I can’t get the correct output.

This is my request (cURL)

curl --get 'https://ads-api.twitter.com/0/targeting_criteria/app_store_categories' --data 'amp%3Bstore=IOS_APP_STORE&q=music' --header 'Authorization: OAuth oauth_consumer_key="XXX", oauth_nonce="XXX", oauth_signature="XXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1429178605", oauth_token="XXX", oauth_version="1.0"' --verbose

Thanks in advance


#2

Hey Hector,

One thing that comes to mind is that looking at that oauth_timestamp it’s from 10:03am this morning; now when you get an OAuth signature from the Signature Generator there is a little notice that says:

Important: This will only be valid for a few minutes. Also remember the cURL command will actually execute the request.

So this might just be because the OAuth signature is no longer valid. Could you try getting another OAuth signature and giving that a go?

Let us know if that solves your problem! If not, could you please paste all the output that comes back from making a request?

Thanks!

Andreas


#3

Hi andreassavviddes,

I made the request in the exact moment I’ve generated the code. I’ve tried in this way because with the php library that I usually use it didn’t work (It works with other methods like, get/target_criteria/devices)

I made again the request and this is the output.

Request:

curl --get 'https://ads-api.twitter.com/0/targeting_criteria/app_store_categories' --header 'Authorization: OAuth oauth_consumer_key="XXX", oauth_nonce="XXX", oauth_signature="XXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1429189515", oauth_token="XXX", oauth_version="1.0"' --verbose

Response:

* Hostname was NOT found in DNS cache
*   Trying 185.45.5.34...
* Connected to ads-api.twitter.com (185.45.5.34) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* Server certificate:
* 	 subject: C=US; ST=CA; L=San Francisco; O=Twitter, Inc.; OU=LON3 Point of Presence; CN=*.twitter.com
* 	 start date: 2015-01-21 00:00:00 GMT
* 	 expire date: 2018-01-24 12:00:00 GMT
* 	 subjectAltName: ads-api.twitter.com matched
* 	 issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 High Assurance Server CA
* 	 SSL certificate verify ok.
> GET /0/targeting_criteria/app_store_categories HTTP/1.1
> User-Agent: curl/7.37.1
> Host: ads-api.twitter.com
> Accept: */*
> Authorization: OAuth oauth_consumer_key="XXX", oauth_nonce="XXX", oauth_signature="XXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1429189515", oauth_token="XXX", oauth_version="1.0"
> 
< HTTP/1.1 404 Not Found
< content-disposition: attachment; filename=json.json
< content-length: 117
< content-type: application/json;charset=utf-8
< date: Thu, 16 Apr 2015 13:05:22 GMT
* Server tsa_f is not blacklisted
< server: tsa_f
< set-cookie: guest_id=v1%3A142918952235118581; Domain=.twitter.com; Path=/; Expires=Sat, 15-Apr-2017 13:05:22 UTC
< strict-transport-security: max-age=631138519
< x-access-level: read-write-directmessages
< x-connection-hash: c02e39be0a2abfa211d0e8722f019010
< x-content-type-options: nosniff
< x-frame-options: SAMEORIGIN
< x-rate-limit-limit: 400
< x-rate-limit-remaining: 399
< x-rate-limit-reset: 1429190422
< x-response-time: 102
< x-runtime: 0.001023
< x-transaction: ce929f318434b596
< x-xss-protection: 1; mode=block
< 
* Connection #0 to host ads-api.twitter.com left intact
{"errors":[{"code":"ROUTE_NOT_FOUND","message":"The requested resource could not be found"}],"request":{"params":{}}}

I want to remark that this method works for me with other url

Thanks!!

Hector


#4

Thanks for coming back with an update!

Another two questions for you so that we can try and get to the bottom of this:

As a side note - if you look here you can see that the error you are getting corresponds to a 404.


#5

Thanks for your answer.

I know that a 404 is a not found error.

  • I’ve never tried this endpoint before.
  • I’m in developer API access level.

But, if I don’t have the correct access level, this should give me an unauthorized access or something related, right?

Regards!


#6

Yup, you are absolutely right - if you don’t have the correct access level, you should be seeing a 403. So that would be another problem in itself that you are not getting the right error code, if that’s the issue! :smile:

I will get back to you as soon as I figure out what’s happening exactly - thanks for your patience!


#7

While you are waiting for me to figure out what the problem actually is, have you tried using twurl to make your requests? Does that make a difference for you?


#8

Yes, of course :stuck_out_tongue:

twurl -H ads-api-sandbox.twitter.com "/0/targeting_criteria/app_store_categories"  | python -m json.tool
{
    "errors": [
        {
            "code": "ROUTE_NOT_FOUND",
            "message": "The requested resource could not be found"
        }
    ],
    "request": {
        "params": {}
    }
}

And I can use twurl to check other methods, I mean, Twurl is well configured

Greetings


#9

I have exactly the same issue.


#10

@andreassavvides Do you have any new information?

Thanks for your time

Regards,


#11

@hector_borras which Twitter account are you making these requests on behalf of? Is it from your account? @is1ue same question for you - If you could give me that information that would really help :smile:


#12

@andreassavvides Twitter account: @is1ue


#13

Thanks!

It looks like the issue is that we made our documentation for that endpoint available, but the actual code that serves that endpoint was not available to external users - oops!

We are working on resolving this and will let you know once the endpoint is live!


#14

Thanks for your reply!

The account I made the request is “@CyberclickAds”, but with your last answer I’ll wait until you resolve this.

Thaks for all your help!!!


#15

@hector_borras and @is1ue - the endpoint should be available & working just fine now!

Let us know if you have any other issues & thanks for your patience.


#16

Yes, the endpoint is available now.
But the sandbox returns no data, can you have a look at it?


#17

Same for me @andreassavvides.

In real ads-api.twitter.com, all works perfectly.

But in ads-api-sandbox.twitter.com i get this output.

{
    data_type: "targeting_criterion"
    data: [0]
    request: {
         params: [0]
    }
}

#18

Well that looks like a bug :slight_smile: We’ll look into that!

In the meantime, since this is just a simple GET endpoint could you just use the non-sandbox URL for your testing & cache the results?


#19

Yes, of course.

Thanks for al :stuck_out_tongue:


#20

@hector_borras @is1ue just so you both know, this is now working as expected on ads-api-sandbox.twitter.com too :slight_smile: Thank you for bringing this to our attention!