question

ElHoussaineMyaz avatar image
ElHoussaineMyaz asked

X-External-Context-ID in "Update an issuance for an ILC"

Hello


I'm currenty testing the "Update an Issuance for an Import Letter Of Credit" API in "Import Letter of Credit" B2B Collection, but I always get the following message :


"Unable to decode the supplied X-External-Context-ID header. The X-External-Context-ID should match the value sent by the corresponding event notification."


How can I get an X-External-Context-ID or what does it look like ?



API - Other
10 |600

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Szymon Patacz avatar image
Szymon Patacz answered

Hello El Houssaine Myaz,


Yesterday we have published new version of postman collection, please redownload collectionand test again if you are facing issues. Please note that this API is using webhooks, in order to receive proper responses edit your application containing Import Letter of Credit API and in Events Tab provide this URL https://subscriberwebhook.azurewebsites.net/
1605876606858.png

Depending on your postman configuration you might need to change pre-request script in Update an issuance of an Import Letter of Credit request:

var delay = pm.environment.get("getIdDelay");
var limit = pm.environment.get("getIdLimit");
var url = pm.environment.get("getIdBaseUrl") + "/import-letter-of-credit/issuances/" + pm.environment.get("id")

to:

var delay = pm. collectionVariables.get("getIdDelay");
var limit = pm.collectionVariables.get("getIdLimit");
var url = pm.collectionVariables.get("getIdBaseUrl") + "/import-letter-of-credit/issuances/" + pm.environment.get("id")


Best Regards,

Szymon Patacz


1605876606858.png (33.3 KiB)
10 |600

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

ElHoussaineMyaz avatar image
ElHoussaineMyaz answered

Hello Szymon,

I downloaded the last version of the API, then I provided the webhooks URL in the events tab of the application:

capture.png


And I changed the pre-request script in Postman:

capture2.png


Now, it takes even more time to get the response, and I get the same error as before :


capture3.png


capture.png (13.7 KiB)
capture2.png (12.0 KiB)
capture3.png (8.4 KiB)
10 comments
10 |600

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Szymon Patacz avatar image Szymon Patacz ♦♦ commented ·

Hello El Houssaine,

Could you share the results from Postman Console as well when you make send the request?


Best Regards,

Szymon Patacz

0 Likes 0 ·
ElHoussaineMyaz avatar image ElHoussaineMyaz Szymon Patacz ♦♦ commented ·

In Postman Console, I first get the following (many failed attempts to fetch external context id). Here is an example:

err1.png


I don't know if getting "undefined" at the end of the URL is normal, I normally add the master ID to the URL like this :


{ {APIMUrl}}/{ {context-root}}/import-letter-of-credit/issuances/32079


Then, under that, I get the following in the console:


err2.png

err3.png

0 Likes 0 ·
err1.png (59.5 KiB)
err2.png (93.0 KiB)
err3.png (23.2 KiB)
Szymon Patacz avatar image Szymon Patacz ♦♦ ElHoussaineMyaz commented ·

Hello,

Have you send Issue an Import "Letter of Credit" and "Issue an Import Letter of Credit for PUT Request" request first? Did it succeeded?

It is mandatory to send these requests first as they are setting up variables used later in Update request both in URL and in Pre-request scripts, and updating the status of letter of credit so it can be updated with PUT request.

To sum up correct workflow is:

1. Send Issue an Import Letter of Credit

2. Send Issue an Import Letter of Credit for PUT Request

3. Send Update an issuance of an Import Letter of Credit

Best Regards,

Szymon

0 Likes 0 ·
Show more comments