manish yadav
04/29/2024, 11:34 AM{
"request": {
"method": "POST",
"url": "/transfer"
},
"response": {
"status": 200,
"jsonBody": {
"message": "transfer succeded!"
},
"headers": {
"Content-Type": "application/json"
}
},
"serveEventListeners": [
{
"name": "webhook",
"parameters": {
"method": "POST",
"url": ""<https://my-target-host/callback>"",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {AUTH_TOKEN}"
},
"body": {"oldState":{},"newState":{}}
}
}
]
}
Are we missing something here 🤔 , Can you please help us with this?
Note - value for AUTH_TOKEN is hardcoded for now.
cc: @kaushik deyLee Turner
04/29/2024, 1:02 PMkaushik dey
04/29/2024, 1:02 PMLee Turner
04/29/2024, 1:42 PMurl
value in the callback section has too many quotes around it and the body
element in the callback section is not the same as the jsonBody
element in the response section. The value of the body
element needs to be a string. This works fine for me:
{
"request": {
"method": "POST",
"url": "/transfer"
},
"response": {
"status": 200,
"jsonBody": {
"message": "transfer succeded!"
},
"headers": {
"Content-Type": "application/json"
}
},
"serveEventListeners": [
{
"name": "webhook",
"parameters": {
"method": "POST",
"url": "<https://my-target-host/callback>",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {AUTH_TOKEN}"
},
"body": "{\"oldState\": {}, \"newState\": {}}"
}
}
]
}
manish yadav
04/29/2024, 2:25 PMLee Turner
04/29/2024, 2:31 PMmanish yadav
04/29/2024, 2:32 PMLee Turner
04/29/2024, 2:33 PMLee Turner
04/29/2024, 2:34 PM2024-04-29 13:38:36.164 Webhook POST request to <https://webhook.site/xxxxxxxxxx> returned status 200
manish yadav
04/29/2024, 2:41 PMIs there anything in the wiremock logs that tells you what response the callback got?Right now we are using wiremock docker image for the same, so I am not really sure if we can put any extra logs over there 🤔
In my logs there was -We also didn't see any issue with the mock api call (2024-04-29 13:38:36.164 Webhook POST request to <https://webhook.site/xxxxxxxxxx> returned status 200
/transfer
)kaushik dey
04/29/2024, 2:43 PMmanish yadav
04/29/2024, 2:43 PMLee Turner
04/29/2024, 3:42 PMRight now we are using wiremock docker image for the same, so I am not really sure if we can put any extra logs over thereWiremock will log the status of the callback already. You might have to set the
verbose
flag to true which you can do in the docker image. Not sure what else to suggest.manish yadav
04/29/2024, 4:26 PMLee Turner
04/29/2024, 4:27 PM