cancel
Showing results for 
Search instead for 
Did you mean: 

Call API Web Service method Put

Souziala
Level 3

Hi every Body, 

I try to update a ticket on EasyVista via an API call but it does not work, it works very well via PostMan but with the action which I created in my web service I have this error :
Internal : Unexpected error Error during Web API HTTP Request
HTTP Status Code: 590
HTTP Response Content: {
    "type": "about:blank",
    "title": "Internal Easyvista Error",
    "status": 590,
    "message": "An internal error occurred.\r\n    Please try again later or contact the system administrator.",
    "correlationId": "657832bd35275",
    "instance": "/api/v1/50004/actions/S230131_072"
}

You Can find more explication with picture Attachment.





------------------------------
SLIMANE OUZIALA
Consultant
Arondor Capture
Europe/Paris
------------------------------
1 BEST ANSWER

Helpful Answers

Hi Slimane,

Yes, you can configure that header in your web service (Valider un Ticket > Request > Headers) like so:

Name: Content-Type

Value: application/json; charset=utf-8

7413.png
If it doesn't work, you might try setting the value to just application/json to see if that works as well. I have seen variation from different APIs.


------------------------------
Charlie Kovacs
Sr. Digital Exchange Engineer
Blue Prism
Austin, USA
------------------------------
Charlie Kovacs

View answer in original post

6 REPLIES 6

Hi Slimane,

An HTTP status code in the 500 range such as this usually means there is a problem on the server side, but I have also found it to mean the request you are sending is malformed in a way that the server is not handling.

It looks like you have an input parameter named Corps that seems to contain a JSON request body. I suggest in your web service action (Valider un Ticket > Request) to select Template on the Body Content drop down, and then enter [Corps] in the text field (as pictured below, for example). I have seen instances where a missing request body on a PUT request like this will cause a 500-level error.

7409.png
Another general suggestion is in your web service action, check the "Enable Request Data Output Parameter" checkbox as well as the "Disable Sending of Request" checkbox. Then, when you attempt to run this action in your process, it will print out the request in a Request Data output parameter. You can use this to compare the request to Postman to see where there might be a difference (URL, headers, body, authentication, etc.)


------------------------------
Charlie Kovacs
Sr. Digital Exchange Engineer
Blue Prism
Austin, USA
------------------------------
Charlie Kovacs

Hi Charlie, 

I appreciate you replay, I flowed your advice, howerver, I have got, tow types of errors, 

I have got this error when I checked the "Disable Sending of Request"

PUT https://edfreit-stg.easyvista.com/api/v1/50004/actions/S230206_154

Content-Type: text/plain; charset=utf-8

Authorisation: Basic *********************************

Authorization: Basic ********************************

{

  "end_action": {

    "doneby_mail": "mycompagnymail@compagny.com"

  }

}

And this error when I Unchecked "Disable Sending of Request" :

Internal : Unexpected error Error during Web API HTTP Request

HTTP Status Code: 590

HTTP Response Content: {

    "type": "about:blank",

    "title": "Internal Easyvista Error",

    "status": 590,

    "message": "An internal error occurred.\r\n    Please try again later or contact the system administrator.",

    "correlationId": "657a02f87bc59",

    "instance": "/api/v1/50004/actions/S230206_154"

}

Thank you for your helping 



------------------------------
SLIMANE OUZIALA
Consultant
Arondor Capture
Europe/Paris
------------------------------

Hi Slimane,

The first output you shared from the "Disable Sending of Request" checkbox is the handy debug information we want to examine. 🙂 In particular, it is showing us the headers that are included in the request.

Headers:

Content-Type: text/plain; charset=utf-8

Authorisation: Basic *********************************

Authorization: Basic ********************************

    One thing I notice is you have two auth headers, one called Authorisation and another called Authorization. I suspect you only need to include one of these in your request. I assume in your web service you have configured authorization in the Common Authentication page which will automatically add an Authorization header to your request. You may also have defined another auth header in the specific action for your web service (Actions > Valider un Ticket > Request > Headers). If you have something for authorization there, I recommend removing it and seeing if your request works.

    Another possible issue is the other header, Content-Type. It is set to a value of text/plain; charset=utf-8 but it may need to be changed to application/json; charset=utf-8 since your request body is JSON-formatted. However, I say that without seeing the documentation for this particular API, so I am speculating here. In my experience, I have seen some APIs are sensitive to this header being absolutely correct.



------------------------------
Charlie Kovacs
Sr. Digital Exchange Engineer
Blue Prism
Austin, USA
------------------------------

Charlie Kovacs

Hi @Charlie

Smart analyze thank you for your investigation, 

Yeah, I have tow Authorization, I deleted one. 

I think the mater problem is the Content-Type.  becauce with Postman i dont have this problem for this call API because I Identify Json type in the body of my request.

But, my question, where can I change the type of the request in the blue prism from text/plain; charset=utf-8  to application/json; charset=utf-8 ?

Thank you in advance



------------------------------
SLIMANE OUZIALA
Consultant
Arondor Capture
Europe/Paris
------------------------------

Hi Slimane,

Yes, you can configure that header in your web service (Valider un Ticket > Request > Headers) like so:

Name: Content-Type

Value: application/json; charset=utf-8

7413.png
If it doesn't work, you might try setting the value to just application/json to see if that works as well. I have seen variation from different APIs.


------------------------------
Charlie Kovacs
Sr. Digital Exchange Engineer
Blue Prism
Austin, USA
------------------------------
Charlie Kovacs

Bonjour @Charlie, 

It works very well, with the first option :

Nom:Content-Type

Valeur:application/json; charset=utf-8

Thank you very much; thank you for your help and your patience 

the problem was the value of my content-Type of my request 



------------------------------
SLIMANE OUZIALA
Consultant
Arondor Capture
Europe/Paris
------------------------------