question

KwongTN-1735 avatar image
0 Votes"
KwongTN-1735 asked KwongTN-1735 answered

The web hook failed completing the challenge/response handshake

I'm trying to add a webhook that notifies / pushes transcription results once they are done. As such, I did the following request:

 {
   "displayName": "Test123",
   "events": {
     "datasetCreation": false,
     "datasetProcessing": false,
     "datasetCompletion": false,
     "datasetDeletion": false,
     "modelCreation": false,
     "modelProcessing": false,
     "modelCompletion": false,
     "modelDeletion": false,
     "evaluationCreation": true,
     "evaluationProcessing": true,
     "evaluationCompletion": true,
     "evaluationDeletion": false,
     "transcriptionCreation": true,
     "transcriptionProcessing": true,
     "transcriptionCompletion": true,
     "transcriptionDeletion": false,
     "endpointCreation": false,
     "endpointProcessing": false,
     "endpointCompletion": false,
     "endpointDeletion": true
   },
   "webUrl": "<redacted>",
   "links": {},
   "properties": {
     "error": {},
     "secret": ""
   },
   "description": "sint laborum sunt veniam dolore",
   "status": "NotStarted",
   "customProperties": {
     "ut_6": "laborum",
     "Lorem_c7": "in tempor deserunt in aute",
     "ad_6cf": "laboris",
     "esse_4_0": "proident ea amet magna"
   }
 }

My application received the following request: "http://<redacted>/azure/speech/v3/?validationToken=a69516b6f3f04c39a98de5e227cbd6"

And returned the following in text form: "a69516b6f3f04c39a98de5e227cbd6"


However during further inspection, I found that the webhook is not being properly registered, with the following error:
The web hook failed completing the challenge/response handshake at 5/10/2022 12:26:04 PM. Challenge response payload doesn't match validation token. Expected: 20d5951df240443c8c363e1d4b4ea696, actual: \"20d5951df240443c8c363e1d4b4ea696\"


I did further checks using curl, and the following happened:

 ╰─➤  curl -X POST 'http://<redacted>/azure/speech/v3/?validationToken=a69516b6f3f04c39a98de5e227cbd6'
 "a69516b6f3f04c39a98de5e227cbd6"%



Help?

azure-speech
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KwongTN-1735 avatar image
1 Vote"
KwongTN-1735 answered

Ok.. So it seems that I've been using Django REST the wrong way..

Instead of doing return Response(response_data, status=status.HTTP_200_OK)

I should have done return HttpResponse(response_data, status=status.HTTP_200_OK), so that there will be no quotemarks.

So... case closed.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.