REST Blob API

ramjiram
Kilo Explorer

Hi,

We have to use blob API to upload data into Third party system using the rest API given to us.

I tried invoking the API from post man and rest advanced chrome client. it was working fine without any issues,

End point:https://XX/API/v1/mam/blobs/uploadblob?filename=test.ipa&organizationgroupid=XXX

Entered all Auth parameters, tenant code etc.

In the body just entered raw data, it worked and gave me the response code 200(OK).

I tried setting up the configuration for the new rest api using system webservice, outbound option in ServiceNow.

1. Entered end point

2. Auth paramters

3. Gave the Content value as simple text "121232" .

Clicked on the Test link for quick test option in the configuration panel, it throws me error "400".

But as far as the setting i did the same, which i did for post man/rest advance client.

If anybody faced such situation, please throw some light what you did to fix this issue.

Regards,

Ram

4 REPLIES 4

martygrinstead
ServiceNow Employee
ServiceNow Employee

Hi Ram,



If your instance is Fuji or later, you can add a new property:


glide.rest.outbound.debug     and   set the value to         true




This will display the request details (including all headers) in the log, and this should show you what's different between the REST Message and the testing you are doing through other clients.




The "400" error is not really detailed enough to know what to suggest to change, but this logging should point something out.




The trick will be to get enough details from another client, and compare that to the debug output.




Hope that helps point you in the right direction,


Marty


Hi Marty,



We are using Eureka version so do not have option to add new property for debugging purpose.



Regards,


Ram


ramjiram
Kilo Explorer

Hi Marty,



We are using Eureka version so do not have option to add new property for debugging purpose.



Regards,


Ram


martygrinstead
ServiceNow Employee
ServiceNow Employee

Hi Ram,



Eureka debugging of outbound REST does not really exist.   There is no way to "getBody()" of the request, so no way to know exactly what is being sent.



Is there any way to get details (application log files or HTTP log files) from the hosted web service?   This may show what's not liked about the request.



You may be able to view the Post Man request (with the headers) and then modify your REST Message to force the same headers.


This will ensure that both requests look the same to the endpoint web server.



Marty