QnAMaker v4 Get unique ids generated by qna maker using the API












-1














In new qna maker v4 i am using the apis to create a new question i am able to create one but i don't get the back the unique id to update or delete the record. I am using PATCH Update Knowledgebase to add a new record/qna pair and GET Operation details to see if the operation succeed, But nowhere can i find the unique id. Can i have some pointers



These are the two API'S i am using
Operations, Update Knowlagebase



1st request to add qna



PATCH /qnamaker/v4.0/knowledgebases/e2f231ec-e47d-4dbb-a4ba-6e6ddeb4eb92 HTTP/1.1
Host: westus.api.cognitive.microsoft.com
Content-Type: application/json
Ocp-Apim-Subscription-Key: fadbedca67d94c6f8f45f05d1d3c2892
cache-control: no-cache
Postman-Token: a43ac861-3cb1-4547-8ccd-6266f67e9692
{
"add": {
"qnaList": [{
"id": 101,
"answer": "Test case 101",
"questions": [
"How do i add case 101?"
],
"metadata": [{
"name": "Cat1",
"value": "aapi"
}]
}
]
}
}



Response: {
"operationState": "NotStarted",
"createdTimestamp": "2018-03-19T07:38:46Z",
"lastActionTimestamp": "2018-03-19T07:39:29Z",
"userId": "86bb8390-56c0-42c2-9f81-3de161981191",
"operationId": "03a4f4ce-30a6-4ec6-b436-02bcdf6153e1"
}



NO Q&A unique id received



second request made using operationId from above 03a4f4ce-30a6-4ec6-b436-02bcdf6153e1



Request: https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/operations/{operationId}--03a4f4ce-30a6-4ec6-b436-02bcdf6153e1



Response: {
"operationState": "Succeeded",
"createdTimestamp": "2018-03-19T07:38:46Z",
"lastActionTimestamp": "2018-03-19T07:39:29Z",
"resourceLocation": "https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/knowledgebases/9d091697-fb8c-4ed5-9ac0-35bf8273bfff",
"userId": "86bb8390-56c0-42c2-9f81-3de161981191",
"operationId": "03a4f4ce-30a6-4ec6-b436-02bcdf6153e1"
}



Still no qna unique ID which is required to edit the qna



Edit Request: PATCH /qnamaker/v4.0/knowledgebases/e2f231ec-e47d-4dbb-a4ba-6e6ddeb4eb92 HTTP/1.1
Host: westus.api.cognitive.microsoft.com
Content-Type: application/json
Ocp-Apim-Subscription-Key: fadbedca67d94c6f8f45f05d1d3c2892
cache-control: no-cache
Postman-Token: 2c82099a-7090-4557-afc4-9d4b111aff33
{
"update": {
"name": "QnA Maker + Emotion API FAQ Bot",
"qnaList": [
{
"id": 443,
"answer": "Cat answer",
"source": "Custom Q&A",
"questions": {
"add": [
"Sample add"
]
}
}
]
}
}



Where will i get the id from 443 that is required to edit the question. The solution provided is one additional call to qna maker and if i want to bulk edit than its not the solution










share|improve this question
























  • can you please share with me why negative vote ? I have the same question posted on github then i posted here.
    – valar morghulis
    Nov 23 '18 at 9:11


















-1














In new qna maker v4 i am using the apis to create a new question i am able to create one but i don't get the back the unique id to update or delete the record. I am using PATCH Update Knowledgebase to add a new record/qna pair and GET Operation details to see if the operation succeed, But nowhere can i find the unique id. Can i have some pointers



These are the two API'S i am using
Operations, Update Knowlagebase



1st request to add qna



PATCH /qnamaker/v4.0/knowledgebases/e2f231ec-e47d-4dbb-a4ba-6e6ddeb4eb92 HTTP/1.1
Host: westus.api.cognitive.microsoft.com
Content-Type: application/json
Ocp-Apim-Subscription-Key: fadbedca67d94c6f8f45f05d1d3c2892
cache-control: no-cache
Postman-Token: a43ac861-3cb1-4547-8ccd-6266f67e9692
{
"add": {
"qnaList": [{
"id": 101,
"answer": "Test case 101",
"questions": [
"How do i add case 101?"
],
"metadata": [{
"name": "Cat1",
"value": "aapi"
}]
}
]
}
}



Response: {
"operationState": "NotStarted",
"createdTimestamp": "2018-03-19T07:38:46Z",
"lastActionTimestamp": "2018-03-19T07:39:29Z",
"userId": "86bb8390-56c0-42c2-9f81-3de161981191",
"operationId": "03a4f4ce-30a6-4ec6-b436-02bcdf6153e1"
}



NO Q&A unique id received



second request made using operationId from above 03a4f4ce-30a6-4ec6-b436-02bcdf6153e1



Request: https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/operations/{operationId}--03a4f4ce-30a6-4ec6-b436-02bcdf6153e1



Response: {
"operationState": "Succeeded",
"createdTimestamp": "2018-03-19T07:38:46Z",
"lastActionTimestamp": "2018-03-19T07:39:29Z",
"resourceLocation": "https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/knowledgebases/9d091697-fb8c-4ed5-9ac0-35bf8273bfff",
"userId": "86bb8390-56c0-42c2-9f81-3de161981191",
"operationId": "03a4f4ce-30a6-4ec6-b436-02bcdf6153e1"
}



Still no qna unique ID which is required to edit the qna



Edit Request: PATCH /qnamaker/v4.0/knowledgebases/e2f231ec-e47d-4dbb-a4ba-6e6ddeb4eb92 HTTP/1.1
Host: westus.api.cognitive.microsoft.com
Content-Type: application/json
Ocp-Apim-Subscription-Key: fadbedca67d94c6f8f45f05d1d3c2892
cache-control: no-cache
Postman-Token: 2c82099a-7090-4557-afc4-9d4b111aff33
{
"update": {
"name": "QnA Maker + Emotion API FAQ Bot",
"qnaList": [
{
"id": 443,
"answer": "Cat answer",
"source": "Custom Q&A",
"questions": {
"add": [
"Sample add"
]
}
}
]
}
}



Where will i get the id from 443 that is required to edit the question. The solution provided is one additional call to qna maker and if i want to bulk edit than its not the solution










share|improve this question
























  • can you please share with me why negative vote ? I have the same question posted on github then i posted here.
    – valar morghulis
    Nov 23 '18 at 9:11
















-1












-1








-1







In new qna maker v4 i am using the apis to create a new question i am able to create one but i don't get the back the unique id to update or delete the record. I am using PATCH Update Knowledgebase to add a new record/qna pair and GET Operation details to see if the operation succeed, But nowhere can i find the unique id. Can i have some pointers



These are the two API'S i am using
Operations, Update Knowlagebase



1st request to add qna



PATCH /qnamaker/v4.0/knowledgebases/e2f231ec-e47d-4dbb-a4ba-6e6ddeb4eb92 HTTP/1.1
Host: westus.api.cognitive.microsoft.com
Content-Type: application/json
Ocp-Apim-Subscription-Key: fadbedca67d94c6f8f45f05d1d3c2892
cache-control: no-cache
Postman-Token: a43ac861-3cb1-4547-8ccd-6266f67e9692
{
"add": {
"qnaList": [{
"id": 101,
"answer": "Test case 101",
"questions": [
"How do i add case 101?"
],
"metadata": [{
"name": "Cat1",
"value": "aapi"
}]
}
]
}
}



Response: {
"operationState": "NotStarted",
"createdTimestamp": "2018-03-19T07:38:46Z",
"lastActionTimestamp": "2018-03-19T07:39:29Z",
"userId": "86bb8390-56c0-42c2-9f81-3de161981191",
"operationId": "03a4f4ce-30a6-4ec6-b436-02bcdf6153e1"
}



NO Q&A unique id received



second request made using operationId from above 03a4f4ce-30a6-4ec6-b436-02bcdf6153e1



Request: https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/operations/{operationId}--03a4f4ce-30a6-4ec6-b436-02bcdf6153e1



Response: {
"operationState": "Succeeded",
"createdTimestamp": "2018-03-19T07:38:46Z",
"lastActionTimestamp": "2018-03-19T07:39:29Z",
"resourceLocation": "https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/knowledgebases/9d091697-fb8c-4ed5-9ac0-35bf8273bfff",
"userId": "86bb8390-56c0-42c2-9f81-3de161981191",
"operationId": "03a4f4ce-30a6-4ec6-b436-02bcdf6153e1"
}



Still no qna unique ID which is required to edit the qna



Edit Request: PATCH /qnamaker/v4.0/knowledgebases/e2f231ec-e47d-4dbb-a4ba-6e6ddeb4eb92 HTTP/1.1
Host: westus.api.cognitive.microsoft.com
Content-Type: application/json
Ocp-Apim-Subscription-Key: fadbedca67d94c6f8f45f05d1d3c2892
cache-control: no-cache
Postman-Token: 2c82099a-7090-4557-afc4-9d4b111aff33
{
"update": {
"name": "QnA Maker + Emotion API FAQ Bot",
"qnaList": [
{
"id": 443,
"answer": "Cat answer",
"source": "Custom Q&A",
"questions": {
"add": [
"Sample add"
]
}
}
]
}
}



Where will i get the id from 443 that is required to edit the question. The solution provided is one additional call to qna maker and if i want to bulk edit than its not the solution










share|improve this question















In new qna maker v4 i am using the apis to create a new question i am able to create one but i don't get the back the unique id to update or delete the record. I am using PATCH Update Knowledgebase to add a new record/qna pair and GET Operation details to see if the operation succeed, But nowhere can i find the unique id. Can i have some pointers



These are the two API'S i am using
Operations, Update Knowlagebase



1st request to add qna



PATCH /qnamaker/v4.0/knowledgebases/e2f231ec-e47d-4dbb-a4ba-6e6ddeb4eb92 HTTP/1.1
Host: westus.api.cognitive.microsoft.com
Content-Type: application/json
Ocp-Apim-Subscription-Key: fadbedca67d94c6f8f45f05d1d3c2892
cache-control: no-cache
Postman-Token: a43ac861-3cb1-4547-8ccd-6266f67e9692
{
"add": {
"qnaList": [{
"id": 101,
"answer": "Test case 101",
"questions": [
"How do i add case 101?"
],
"metadata": [{
"name": "Cat1",
"value": "aapi"
}]
}
]
}
}



Response: {
"operationState": "NotStarted",
"createdTimestamp": "2018-03-19T07:38:46Z",
"lastActionTimestamp": "2018-03-19T07:39:29Z",
"userId": "86bb8390-56c0-42c2-9f81-3de161981191",
"operationId": "03a4f4ce-30a6-4ec6-b436-02bcdf6153e1"
}



NO Q&A unique id received



second request made using operationId from above 03a4f4ce-30a6-4ec6-b436-02bcdf6153e1



Request: https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/operations/{operationId}--03a4f4ce-30a6-4ec6-b436-02bcdf6153e1



Response: {
"operationState": "Succeeded",
"createdTimestamp": "2018-03-19T07:38:46Z",
"lastActionTimestamp": "2018-03-19T07:39:29Z",
"resourceLocation": "https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/knowledgebases/9d091697-fb8c-4ed5-9ac0-35bf8273bfff",
"userId": "86bb8390-56c0-42c2-9f81-3de161981191",
"operationId": "03a4f4ce-30a6-4ec6-b436-02bcdf6153e1"
}



Still no qna unique ID which is required to edit the qna



Edit Request: PATCH /qnamaker/v4.0/knowledgebases/e2f231ec-e47d-4dbb-a4ba-6e6ddeb4eb92 HTTP/1.1
Host: westus.api.cognitive.microsoft.com
Content-Type: application/json
Ocp-Apim-Subscription-Key: fadbedca67d94c6f8f45f05d1d3c2892
cache-control: no-cache
Postman-Token: 2c82099a-7090-4557-afc4-9d4b111aff33
{
"update": {
"name": "QnA Maker + Emotion API FAQ Bot",
"qnaList": [
{
"id": 443,
"answer": "Cat answer",
"source": "Custom Q&A",
"questions": {
"add": [
"Sample add"
]
}
}
]
}
}



Where will i get the id from 443 that is required to edit the question. The solution provided is one additional call to qna maker and if i want to bulk edit than its not the solution







qnamaker






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 21 '18 at 4:56

























asked Nov 23 '18 at 4:50









valar morghulis

1,5141727




1,5141727












  • can you please share with me why negative vote ? I have the same question posted on github then i posted here.
    – valar morghulis
    Nov 23 '18 at 9:11




















  • can you please share with me why negative vote ? I have the same question posted on github then i posted here.
    – valar morghulis
    Nov 23 '18 at 9:11


















can you please share with me why negative vote ? I have the same question posted on github then i posted here.
– valar morghulis
Nov 23 '18 at 9:11






can you please share with me why negative vote ? I have the same question posted on github then i posted here.
– valar morghulis
Nov 23 '18 at 9:11














1 Answer
1






active

oldest

votes


















0














Please be more clear with the structure of your question.



What I understand is that you want to do these two things:




  • modify a Question and Answer Pair

  • remove a Question and Answer Pair


Before you do any of those two things you need to retrieve the question and answer pairings using this API below.



https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/quickstarts/csharp#get-answers-to-a-question-by-using-a-knowledge-base



Using this API guide (change the programming language dependent on your code), it returns a JSON response. That JSON response will hold the unique 'id's' of each answer to the question.



Hope this helps!






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53440802%2fqnamaker-v4-get-unique-ids-generated-by-qna-maker-using-the-api%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Please be more clear with the structure of your question.



    What I understand is that you want to do these two things:




    • modify a Question and Answer Pair

    • remove a Question and Answer Pair


    Before you do any of those two things you need to retrieve the question and answer pairings using this API below.



    https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/quickstarts/csharp#get-answers-to-a-question-by-using-a-knowledge-base



    Using this API guide (change the programming language dependent on your code), it returns a JSON response. That JSON response will hold the unique 'id's' of each answer to the question.



    Hope this helps!






    share|improve this answer


























      0














      Please be more clear with the structure of your question.



      What I understand is that you want to do these two things:




      • modify a Question and Answer Pair

      • remove a Question and Answer Pair


      Before you do any of those two things you need to retrieve the question and answer pairings using this API below.



      https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/quickstarts/csharp#get-answers-to-a-question-by-using-a-knowledge-base



      Using this API guide (change the programming language dependent on your code), it returns a JSON response. That JSON response will hold the unique 'id's' of each answer to the question.



      Hope this helps!






      share|improve this answer
























        0












        0








        0






        Please be more clear with the structure of your question.



        What I understand is that you want to do these two things:




        • modify a Question and Answer Pair

        • remove a Question and Answer Pair


        Before you do any of those two things you need to retrieve the question and answer pairings using this API below.



        https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/quickstarts/csharp#get-answers-to-a-question-by-using-a-knowledge-base



        Using this API guide (change the programming language dependent on your code), it returns a JSON response. That JSON response will hold the unique 'id's' of each answer to the question.



        Hope this helps!






        share|improve this answer












        Please be more clear with the structure of your question.



        What I understand is that you want to do these two things:




        • modify a Question and Answer Pair

        • remove a Question and Answer Pair


        Before you do any of those two things you need to retrieve the question and answer pairings using this API below.



        https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/quickstarts/csharp#get-answers-to-a-question-by-using-a-knowledge-base



        Using this API guide (change the programming language dependent on your code), it returns a JSON response. That JSON response will hold the unique 'id's' of each answer to the question.



        Hope this helps!







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 30 '18 at 0:54









        Yanzal

        414




        414






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53440802%2fqnamaker-v4-get-unique-ids-generated-by-qna-maker-using-the-api%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            What visual should I use to simply compare current year value vs last year in Power BI desktop

            How to ignore python UserWarning in pytest?

            Alexandru Averescu