1
votes

I just created a qna knowledge base but i'm finding it difficult to consume the endpoint api. I have actually done this before Microsoft changed the endpoint configuration features. please find below my test credentials

POST /knowledgebases/6a523867-3606-480e-9179-bd7e06df4b4d/generateAnswer
Host: https://kb12.azurewebsites.net/qnamaker
Authorization: EndpointKey 604c416d-ef24-402d-b889-cbbb4c16a396
Content-Type: application/json
{"question":"hi"}

i used `Ocp-Apim-Subscription-Key: 604c416d-ef24-402d-b889-cbbb4c16a396 but i keep getting 502 error .

2
If this isn't a public knowledge base, please remove the key from the text above.DFBerry
its a public knowledge baseOluwatosin Samuel Babalola
i just need a solution to the qna v4.0 issueOluwatosin Samuel Babalola
how do i get answer to question through the API????Oluwatosin Samuel Babalola
Hi @OluwatosinSamuelBabalola, you can use postman to make request to the API. Or add tls1.2, for details, please refer to my reply.Fei Han

2 Answers

1
votes

keep getting 502 error

I do a test using fiddler and can reproduce same issue, to solve the issue, you can go Tools > Options > HTTPS to make tls1.2 allowable.

enter image description here

Test result:

enter image description here

0
votes

Curl example that works for me -

replace xxxx..., yyyy...., and myazureresourcename with your own values shown on the publish page.

curl \
--header "Content-type: application/json" \
--header "Authorization: EndpointKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
--request POST \
--data '{"question":"what is my endpoint?"}' \
https://myazureresourcename.azurewebsites.net/qnamaker/knowledgebases/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy/generateAnswer