cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix Invalid content-type error message while using API in blueprism

NehaGote
Level 4
Hi,
I am using put method of service now API. I am passing the sys id of ctask. I have setup common header content type as application/json. Getting the below error 


ERROR: Internal : Unexpected error Error during Web API HTTP Request

HTTP Status Code: 415

HTTP Response Content: {"error":{"detail":null,"message":"Invalid content-type. Supported request media types for this service are: [application/json, application/xml, text/xml]"},"status":"failure"}
30473.png
In closectask action I am directly passing the sys ID value. Do I have to change the format of sys id to json before passing it?



------------------------------
Neha Gote
------------------------------
6 REPLIES 6

ewilson
Staff
Staff
Hi @NehaGote,

It looks like you're creating your own Web API implementation for the Service Now API. Have you tried any of the existing Web APIs for Service Now available on the Digital Exchange?

Can you share the definition of your Web API service? Does your header definition look like this:
30448.png

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson,

Nopes I am not using it from digital exchange. Below is header definition

30450.png
Below is the closectask definition

/api/now/table/change_task/[sys_id]?sysparm_fields=number,sys_id,due_date,state,sys_id,u_automation_initiator,change_request,assignment_group,short_description,work_notes,opened_by

------------------------------
Neha Gote
------------------------------

Verify that your header definition matches what I've shown above and that there isn't an extra white space before or after the header name or value.

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson

I verified header definition no luck with it still  getting the same error msg​

------------------------------
Neha Gote
------------------------------

The header name in your screenshot shows Contect-Type. It should be Content-Type. Notice the lower case "c" in yours. That should be a lower case "n".

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson ,

You are right I missed on the content-type spell. It is working now thank you!:)​​

------------------------------
Neha Gote
------------------------------