Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Igor Touguinhó
    [Knowledge Advanced] Update content errorAnswered
    Topic posted October 28, 2019 by Igor TouguinhóBlue Ribbon: 750+ Points, tagged REST 
    15 Views, 5 Comments
    Title:
    [Knowledge Advanced] Update content error
    Summary:
    I can't update any content because of a recordId invalid error
    Content:

    Hello,

    I'm testing update content service on KA Rest API, but I'm getting the following error (see code below):

    {
        "error": {
            "title": "An application error has occurred. Root cause: Invalid value for [299EF269FFDE46789E02D43A2C8E952C]",
            "errorPath": null,
            "errorCode": "OK-GEN0003",
            "type": "APPLICATION",
            "detail": null
        },
        "errorDetails": [
            {
                "title": "Invalid value for [299EF269FFDE46789E02D43A2C8E952C]",
                "errorPath": "recordId",
                "errorCode": "OK-GEN0024",
                "type": "VALIDATION",
                "detail": null
            }
        ]
    }

     

    I got this recordId on GET content service:

    {
        "recordId": "299EF269FFDE46789E02D43A2C8E952C",
        "versionId": "2EFC2007AAC543DAB3989CDB80864F82",
        "documentId": "INT95",
        "title": "TEST CONTENT",
        "version": "1.0",
        "answerId": 1004336,
        "locale": {
            "recordId": "pt_BR"
        },
        "dateModified": "2019-10-25T17:02:52-0300",
    }

    I need help !!!

    Version:
    19C
    Code Snippet:

    Best Comment

    Igor Touguinhó

    Joram,

     

    They answered my SR, the problem was the ID on PUT request.

    Instead of PUT /km/api/latest/content/1004336 in my case, I had to put /km/api/latest/content/299EF269FFDE46789E02D43A2C8E952C

    The ID on URL is the recordId, not the documentID or answerID.

    Comment

     

    • Joram Betgen

      Hi Igor, 

      I'm getting the same error on a 19B instance of Oracle Service Cloud. I do exactly the same thing. At first i get the complete answer JSON by calling /km/api/latest/content/answers/<answerid>?mode=FULL&isForEdit=true. Then i use that JSON as the request input into my PUT call and i get the same error message.

      I'm calling the api with a userToken of the same console user that created the answer in OKA. The api user has the rights to call the content update function so there should be no problems.

      Did you already figured this one out?

      • Igor Touguinhó

        No :(

         

        I'm opening a SR to solve this problem .

         

         

      • Igor Touguinhó

        Joram,

         

        They answered my SR, the problem was the ID on PUT request.

        Instead of PUT /km/api/latest/content/1004336 in my case, I had to put /km/api/latest/content/299EF269FFDE46789E02D43A2C8E952C

        The ID on URL is the recordId, not the documentID or answerID.

        • Thom Blake

          Darn it! If I'd looked at the forum first, I could've gotten points here for the answer instead of solving the service request.

          I'm glad I could help, Igor, and thanks for posting the solution for other folks.