Sorry, you need to enable JavaScript to visit this website.

You are here

Authenticating API

3 posts / 0 new
Last post

Adrian's picture
by Adrian

Authenticating API

I am hoping someone can assist please:

We can authenticate with our key/secret, but when trying to send sms there is an error. We used example of request on: https://dev.telstra.com/content/messaging-api#tag/Messaging

 

Here is the output:

 

~> curl -X POST -H "Authorization: Bearer AMTYWGSh37xaAx5yEOBebqnsr5Iq" -H "Content-Type: application/json" -d '{"to":"+61417189341", "body":"Test Message"}' https://tapi.telstra.com/v2/messages/sms

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100   200  100   156  100    44     38     10  0:00:04  0:00:04 --:--:--    49

                          {

                        "status":"404",

                                "code":"RESOURCE-NOT-FOUND",

                                "message":"Invalid resource. Refer to API docs at https://dev.telstra.com"

                          }

Jarra's picture
by Jarra

Potential answer

Hey,

 

I just started playing around with the API the other day so dont take this as gospel.

I believe you need to create a subscription first so that the API knows what number to send from.

A subscription reserves your sending number (free API only reserves for 30 days).

 

Workflow:

Auth > Create Subsciption > Send SMS

 

Also I had issues sending messages without specifing a 'validity' so make sure you specify that too.

 

Hope this helps.

Michelle's picture
by Michelle

SOLVED: 404 RESOURCE-NOT-FOUND

Thanks jarrataurian that's exactly right!

There are several situations which could cause a 404 error like this (noted, we will update the documentation to be more specific on the cases that will cause this 404 error!).

 

In your case adrian_2, I can see that the erorr was flagged due to Invalid from address specified. I can also see that you have been able to send messages as of yesterday, so please confirm if the issue still persists!

Log in or register to post comments