REST API "Status 500" Error

brycefraser
Giga Contributor

Hey everyone,

I am trying to implement the Telstra SMS API within ServiceNow, this API allows us to SMS to Australian numbers via REST messages.


I have been able to make the API work fine through manual coding (e.g. constructing the REST message in Powershell and running it, for example), however everytime I try to add it into ServiceNow, I recieve a 'Status 500 Internal Error' message.

The API is fairly simple (T.DEV | SMS Getting started). OAuth is set up and retrieving the token fine, however when "Send SMS" is utilised it returns that error.

This is the format from the API:

# * Recipient number should be in the format of "04xxxxxxxx" where x is a digit

# * Authorization header value should be in the format of "Bearer xxx" where xxx is access token returned

#     from a previous GET https://api.telstra.com/v1/oauth/token request.

RECIPIENT_NUMBER="your number"

TOKEN="<access_token>"

curl -H "Content-Type: application/json" \

-H "Authorization: Bearer $TOKEN" \

-d "{\"to\":\"$RECIPIENT_NUMBER\", \"body\":\"Hello!\"}" \

"https://api.telstra.com/v1/sms/messages"

A successfully sent message looks like this:

message sent.JPG

What i've currently got set up is this.

Here is the REST Message:

rest message.JPG

And here is my post method:

find_real_file.png

I'm honestly not sure how to proceed with this or what I am missing.

Telstra advises that the status 500 error is:

500 Internal ServerAn internal error occurred when processing the request

It does say internal error occurred, however I'm definitely sure it is something to do with how i've set the messages up, as I do not get an error when running a rest message through Powershell.

Does anyone have any ideas of where I can go from here?

Is there a way I can view the actual rest message that is being sent out when I hit "test"?

Thanks for your help!

7 REPLIES 7

Indrajeet
Mega Expert

Hi Bryce



Can you please declare the Http Request parameters


Please see the image for reference .demo.PNG


Hi Indrajeet,


Thank you for your response



I have just tried this and unfortunately I receive the same error. Here is the set up followed by a screenshot of the error:



find_real_file.png



find_real_file.png


Hi Bryce,



I am facing the same issue ,Can i know how did you solved this issue.



Thanks In advance


Thanks


Sandeep