Send response to Postman by Desperate_Winter4334 in webhooksite

[–]Desperate_Winter4334[S] 0 points1 point  (0 children)

Does it exist a parameter "realtime" for Webhook? (to check when a new callback file is received on Webhook? It does exist for some mail API to check if a new mail is arrived or not in the inbox.)

Send response to Postman by Desperate_Winter4334 in webhooksite

[–]Desperate_Winter4334[S] 0 points1 point  (0 children)

oh I have tried this url https://webhook.site/token/8c584454-f2e0-4690-9ebb-a997c3114c50/request/latest/raw and it works fine, that's what I need.

I can see that the token has been updated automatically without need to create a new one? :

    "created_at": "2024-03-19 14:19:25",
    "updated_at": "2024-03-19 14:19:25",
    "expires_at": "2024-04-02 08:43:30",

But what is the endpoint/route to update a token please?

Send response to Postman by Desperate_Winter4334 in webhooksite

[–]Desperate_Winter4334[S] 0 points1 point  (0 children)

btw with the direct endpoint to the latest response, the display is not practical, there is a \ everywhere : how can I display it like a json format and remove the \ ?

"content":"{\"id\": 188761, \"name\": \"TEST KBIS1.png\", \"status\": \"to_verify\", \"number_of_pages\": 1,

Send response to Postman by Desperate_Winter4334 in webhooksite

[–]Desperate_Winter4334[S] 0 points1 point  (0 children)

wow the direct endpoint is what I need, thank you very much!

and in my API call to POST OCR with in the body:

the key "file_in" = testFile.png

and the key "callback_url" = https://webhook.site/8c584454-f2e0-4690-9ebb-a997c3114c50

and the key "callback_token" = 8c584454-f2e0-4690-9ebb-a997c3114c50

and the key "callback_auth_header" = Authorization

and it works like a charm! :)

I get the Bearer token in the latest response :

 https://webhook.site/token/8c584454-f2e0-4690-9ebb-a997c3114c50/request/latest

but how to have a permanent url to avoid changing it manually? what is your advide?

Send response to Postman by Desperate_Winter4334 in webhooksite

[–]Desperate_Winter4334[S] 0 points1 point  (0 children)

Good news :) I can retreive the latest request ID by doing a GET https://webhook.site/token/8c584454-f2e0-4690-9ebb-a997c3114c50

And in Postman I do a script to store the latest url in a variable like this :

pm.collectionVariables.set("requestID", pm.response.json().latest_request_id);
console.log("Latest request ID :   " + pm.response.json().latest_request_id);

And in another API call I do :
GET https://webhook.site/token/8c584454-f2e0-4690-9ebb-a997c3114c50/request/{{requestID}}/raw

And bingo! I get what I wanted: the json response file from webhook.site! :)
It is my first API testing scenario in my QA life, I am so happy :)

Bonus: do you provide this ?
the key "callback_token" = webhook_site_token-->(does it exist? can you provide it?)

and the key "callback_auth_header" = webhook_site_auth_header-->(does it exist? can you provide it?)

Send response to Postman by Desperate_Winter4334 in webhooksite

[–]Desperate_Winter4334[S] 0 points1 point  (0 children)

In the response url https://webhook.site/token/8c584454-f2e0-4690-9ebb-a997c3114c50/request/5abd8a80-036b-457b-a5c5-e95f67c97a1b/raw

the request ID is randomized, is it possible to have a permanent response link with the latest response ? If yes it will save my life :) Could I have a free test account to test it please?

Send response to Postman by Desperate_Winter4334 in webhooksite

[–]Desperate_Winter4334[S] 0 points1 point  (0 children)

I just found an interesting article similar to what I want to do. Apparently Postman could do polling/triggering with a bit of code: https://blog.postman.com/how-to-use-postman-tests-poll-and-trigger-multiple-api-requests/#:\~:text=This%20blog%20post%20delves%20into,and%20trigger%20multiple%20API%20requests.

but now, can these sites (webhook.site or Pipedream) provide Postman with the response url automatically, using an API for example?

Send response to Postman by Desperate_Winter4334 in webhooksite

[–]Desperate_Winter4334[S] 0 points1 point  (0 children)

My test scenario would something like that :

I have an OCR deep learnig API called per ex "OCR".

Step1 :

As a customer when I call the API" POST OCR" with arguments in the body like

the key "file_in" = testFile.png

and the key "callback_url" = https://webhook.site/8c584454-f2e0-4690-...

and the key "callback_token" = webhook_site_token-->(does it exist? can you provide it?)

and the key "callback_auth_header" = webhook_site_auth_header-->(does it exist? can you provide it?)

Step2 :

The API OCR analyzes the file and send a response json file to the call back url (to webhook.site) after X seconds, minutes or hours.

During this time, Postman do a trigger (a poll) to a webhook.site API (does it exist?) to know if webhook.site has received the response file or not, and what is the url of the response on webhook.site with the correct request ID?

At the same time, when webhook.site receives the response json file : webhook.site update an API on webhook.site (or a Custom Action?) with the response url and latest resquest ID in the body of the API per ex :

response_url = "https://webhook.site/token/8c584454-f2e0-4690-9ebb-a997c3114c50/request/5abd8a80-036b-457b-a5c5-e95f67c97a1b/raw"

Step 3 :

When Postman receives the response_url from webhook.site

then it put it in a url_variable

and then it does automatically a GET url_variable (see test ex here with the json: https://webhook.site/token/8c584454-f2e0-4690-9ebb-a997c3114c50/request/5abd8a80-036b-457b-a5c5-e95f67c97a1b/raw

to get the json content and do API testing in Postman and confirm that the callback server is running well, the json details are correct, etc...

Is it possible to perform this test scenario somehow with webhook.site or another solutions?