Web service to update asset status

I am running a workflow that goes and gets the asset information successfully but won't successfully patch update the status.  When I test the update status call it works.  Is there a way to see what the web service is using in a web call? I'm using 

Request Endpoint

PATCH https://bgsu.teamdynamix.com/SBTDWebApi/api/950/assets/{{ID}}

And getting: Response Status Code/Description

405 Method Not Allowed

I'm storing the Get Asset information in the response body as: AssetInfoRespBody.  Then in the patch call I call the parameter as AssetInfoRespBody.ID (I have also tried BackingItemID)  

Body: [
{"op":"replace","path": "/StatusID", "value": 2963}
]

Asked by Danee Gunka Schwartz on Tue 6/13/23 1:53 PM
Sign In to leave feedback or contribute an answer

Answer (1)

This answer has been marked as the accepted answer
Mark Sayers Wed 6/14/23 3:13 PM

Hello Danee,

If you've actually tested this in a workflow by letting the workflow attempt to make the web service step's call, there should be logs located within the TDAdmin area of that Ticketing app under the Workflow Web Services navigation option, in the Workflow Web Service Logs area.

This should show you both the URL that was called and also the body content of the call in question (if applicable).

Sincerely,
Mark Sayers
Sr Support Consultant, CS

No feedback
It doesn't seem to be passing the ID number. the {{ID}} part of the url is blank. The get function is running properly. Somehow I'm messing up passing the parameter through the workflow. - Danee Gunka Schwartz Wed 6/14/23 3:19 PM
Is this in Production or Sandbox? Also, what is the name of the web service method? - Mark Sayers Wed 6/14/23 3:33 PM
I believe what is needed is to format your Parameter's "Source Property" field value like so: AssetInfoRespBody.[0].BackingItemID

The reason for this is that the response of the GET is in an Array of assets, so you have to reference the array index position of the asset. I'm assuming the asset in question will always be in the first position of the returned array, so you reference that by adding the [0] in the value of the source property between the name of the GET's response body name and the property from that array that you wish to retrieve.
- Mark Sayers Wed 6/14/23 3:41 PM
Mark,

That was it!!! I keep forgetting that dange [0]!!!! Thank you so much!!!
- Danee Gunka Schwartz Wed 6/14/23 3:59 PM
You're welcome! - Mark Sayers Wed 6/14/23 4:00 PM