Hi, I have created successful requests through Postman to our Carrier to create a consignment but im having issue converting to Custom Code in a BPM through Epicor.
I currently have the code below which works and retrieves a Token to use in the next Rest call.
I am unsure of how to add a field from the response as a variable for the next rest call.
@stoyanlevakov
Thank you for pointing me in this direction, I’m getting somewhere.
I have tried the following but instead of using the ‘key’ i retrieved from the rest call it just shows whatever is typed between the 2 quote marks on the ‘string json’ line
@stoyanlevakov Apologies for opening this back up.
I have tried searching for methods on how to serialize a json list but I’m coming up with nothing.
for example,
The below is my code (i know the trackingNumbers section is completely incorrect)
The SERVICE deserialization works perfectly but I’m failing on the bottom trackingNumbers section.
Any help here would be greatly appreciated.
var bodyrl = new {
trackingNumber = ShipHead.TrackingNumber,
printWholeConsignment = true
};
requestrl.AddJsonBody(bodyrl); // Anonymous type object is converted to Json body
I don’t think serialization is needed when using RestSharp
Sorry again, I’m having some real trouble sending address data to the API now.
The code on the right works fine but i cant dynamically change the address details.
The code on the left throws Json Deserialization errors and i cannot find why it is incorrect.
Any ideas?