Core Case API problem with Postman when trying to create a case instance

Options
Florent Melchers
edited March 14, 2023 in Services #1

Hello

I try to create an instance of a case but we receive an error {"errors":[{"code":4059,"message":"Error while creating case instance"}]}

POST https://eu-1.api.opentext.com/case/api/v1/case-definitions/96313279-a1ca-43a4-8144-a47c5af043f5/cases

The problem seems to be linked to the file testCase.json in the console there's :

Any idea ?

Thanks

Florent

Tagged:

Comments

  • gvicari
    gvicari E Community Moderator
    Options

    Hi @Florent Melchers, can you confirm you indeed have a Core Case subscription, and if so, can you confirm that you have tried the different examples as described here? I.e.: did you go over the different calls and confirmed that at least some of it works, or is nothing working?

  • Hi Gino

    Yes we have a valid core case subscription. We can do other calls like "Get Users" or "Get Cases Definition", it works. We used the examples from the documentation “Core Case Api Overview”, it was useful. In the meantime, the problem seems to be identified, it's not solved yet. It's linked to the fact that we should send a file in the body form-data. I will leave some more information when it's solved.

    Florent

  • gvicari
    gvicari E Community Moderator
    Options

    OK, thanks and good hunting!

  • Hi @Florent Melchers

    Do you found something to fix this ? I will be interested if you have a solution because I'm facing the same issue on the Postman call.
    I also tried to make the call with a NodeJs script (some data have been replaced by chevrons <>):

      axios.post(
        '<data-center-base-url>/case/api/v1/case-definitions/<id>/cases',
        form,
        {
          headers: {
            'Content-Type': 'multipart/form-data',
            Authorization: `Bearer ${access_token}`
          }
        }  
      ).then((res) => {
        console.log(res)
      }).catch((err) => {
        for (const value of err.config.data.values()) {
          value.text().then((data) => console.log(data))
        }
        console.log(err.response.data)
        console.log(err.config.headers)
        console.log(err.response.status)
        console.log(err.response.headers)
      })
    

    Where the response is:

    Error response data: {
    errors: [ { code: 4059, message: 'Error while creating case instance' } ]
    }
    Request headers: AxiosHeaders {
    Accept: 'application/json, text/plain, /',
    'Content-Type': 'multipart/form-data; boundary=axios-1.3.4-boundary-jE6PpKKwQVDSo_wEi7fob0fFi',
    Authorization: 'Bearer <access_token>'
    'User-Agent': 'axios/1.3.4',
    'Content-Length': '651',
    'Accept-Encoding': 'gzip, compress, deflate, br'
    }
    Error response status: 500
    Error response headers: AxiosHeaders {
    date: 'Wed, 29 Mar 2023 14:09:55 GMT',
    'content-type': 'application/json',
    'transfer-encoding': 'chunked',
    connection: 'close',
    'cache-control': 'no-cache, no-store, max-age=0, must-revalidate',
    expires: '0',
    pragma: 'no-cache',
    'set-cookie': [
    'BIGipServerdevxprod.ot2.opentext.com_80=3706034954.20480.0000; path=/; Httponly; Secure',
    'BIGipServerdevxprod.ot2.opentext.com_80=3706034954.20480.0000; path=/; Httponly; Secure',
    'BIGipServerdevxprod.ot2.opentext.com_80=3722812170.20480.0000; path=/; Httponly; Secure'
    ],
    'strict-transport-security': 'max-age=31536000 ; includeSubDomains, max-age=297402057; includeSubDomains, max-age=297402057; includeSubDomains, max-age=297402057; includeSubDomains',
    vary: 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers',
    'x-content-type-options': 'nosniff',
    'x-frame-options': 'DENY',
    'x-response-time': '1969',
    'x-vcap-request-id': '9d3c0564-2e31-413f-5b43-d6d054180e7f',
    'x-xss-protection': '1; mode=block',
    'access-control-expose-headers': 'Content-Disposition, Content-Length',
    'access-control-allow-origin': '*',
    'access-control-allow-headers': 'origin, x-requested-with, accept, authorization, content-type, x-view-request-id',
    'access-control-max-age': '3628800',
    'access-control-allow-methods': 'HEAD, GET, DELETE, PUT, POST, PATCH, OPTIONS',
    'access-control-allow-credentials': 'false'
    }
    Sended FormData 'caseInstance' key value: {"caseType":{"id":"<case_type_id>"},"caseConfigId":"<id>","caseProperties":{"defaultAttributes":{"caseTitle":"Ouverture de compte John DOE 3","summary":"Ouverture de compte John DOE 3","clientName":"John DOEEE","caseAssignee":{"id":"<id>","email":"matthieu.vigier@aerow.fr","name":"Matthieu Vigier","label":"Matthieu Vigier","isAdmin":true}},"customAttributes":{"data":{"ca_nom":"DOEEE","ca_prenom":"John"},"caseConfigId":"<id>"}}}

    I also made an other call on Postman, where I called the file 'caseinstance.json' as described in the doc and I got the following error, which look different of the one you got:

    "errors": [
      {
        "code": 3406,
        "message": "Case exception"
      }
    ]
    

    So if you don't found any solution, any suggestion will be appreciated

  • Hi @VigierM

    The problem is not solved but it's under analysis.

    And on your side, the other calls work ? List case for example ?

    I keep you informed.

    Florent

  • Hi @Florent Melchers

    Yes I'm able to do every GET calls. I didn't tested all the POST one for the moment as I only needed to test the case creation.

    Actually I'm stuck on your error message or the one I had above. And as it is only some error status code 500, I don't really have information to debug this.

    Thank you for your time, I'll stay tuned

  • All,

    There is an open issue in creating Case Instance when the case is configured against Core Content as Content Management repo, the fix for this will be available very soon like by end of April.

    As a work around you can change the Content Repository to OCP Cloud storage within Content Management section of the case type, this should allow you to create case attach documents and other operations too…

    -Sriram.A