Web API: Unable to send Parameters.

Hi All,

By using POST method I am performing a task, below is it's body content:

{
"taskNumber":"SCTASkXXXXX",
"taskState":"Closed Complete",
"workNotes":"User Added.",
"comments":"",
"closeNotes":"Task closure done."
}

Now issue is, value of taskNumber needs to be changed in every iteration, so I need to pass taskNumber as a variable so that it's value keeps on changing.
Currently it's value is hardcoded and we don't want that.
How can we achieve that in Blue Prism?

Any help would be appreciated!!

Regards
Dinesh
 

sahil_raina_91

Active Member
There can be various ways to do this:

One way is to store the skeleton of BODY in a data item, lets call it [Body]. See below:
{
"taskNumber":"PLACEHOLDER",
"taskState":"Closed Complete",
"workNotes":"User Added.",
"comments":"",
"closeNotes":"Task closure done."
}

Create another data item, lets call it [TaskNo] which will store those values like SCTASkXXXXX , SCTASYYYYYY, SCTASkZZZZZZ

Finally,
Use a calculation stage to replace PLACEHOLDER in [Body] with [TaskNo].
Function : Replace([Body],"PLACEHOLDER",[TaskNo])
 
Thanks @sahil_raina_91 for replying,

I have some what tried to use your method.
I am taking all data into a collection and using that collection calling HTTP Requests.
However I am getting below error message
{"result":{"status":"Error","statusMessage":"Task number is empty. Task update failed."}}

Body:
{"Incident":{"taskNumber":"SCTASKXXXX","taskState":"Closed Complete","workNotes":"User Added.","comments":"","closeNotes":"Task closure done."}}

Below is the method I am using

View attachment 1590738342181.png

Let me know if you can help!!!

Regards
Dinesh
 

sahil_raina_91

Active Member
Without any information about the API , it's next to impossible to debug the response generated by the API.
From what I can tell, the request is hitting the endpoint and you are receiving the response as well (No 4XX series error)

The response states that the Task number is empty, and I cant help but notice a difference in inputs (lowercase and uppercase K). This might be trivial and not the actual issue.

LATEST REPLY
Body:
{"Incident":{"taskNumber":"SCTASKXXXX","taskState":"Closed Complete","workNotes":"User Added.","comments":"","closeNotes":"Task closure done."}}

FIRST MESSAGE
{
"taskNumber":"SCTASkXXXXX",
"taskState":"Closed Complete",
"workNotes":"User Added.",
"comments":"",
"closeNotes":"Task closure done."
}

Other than that, I am not sure if I can offer any further help without having access to API documentation.
Maybe somebody else can give you inputs.
 
Top