Post

1 follower Follow
1
Avatar

API update of entity project fails

I'm sending the following JSON request:

POST https://apie.clarizentb.com/V2.0/services/data/upsert

{

    "updateEntity": {

        "id": "/Project/5avjomandmtdub42sclqsvl6f78",

        "Name": "TEST FS API Query and Update"

    }

}

and receive the following response:

{

    "errorCode": "Internal",

    "message": "We’re sorry, something seems to have gone wrong.\r\nIf you need our team to investigate, have your Administrator open a support ticket with this error code:",

    "referenceId": "3uO07Dv1zki86kfcBa1cJF"

}

What should be the correct request?

Thanks in advance and best regards,

Frank

Frank Sieweke Answered

Please sign in to leave a comment.

2 comments

1
Avatar

I found an older post titled "Upsert fail with 500 error". It is suggested that the body should also contain an "insertEntity".

But that does not do the job. The request

{
    "insertEntity": {},
    "updateEntity": {
        "Id": "/Project/5avjomandmtdub42sclqsvl6f78",
        "Name": "TEST FS API Queries and Updates"
    }
}
 
leads to response
 
{
    "errorCode": "MissingArgument",
    "message": "Missing argument: typeName",
    "referenceId": "3u98ngmFpRefIkALlDZrYz"
}
 
The addressed project is an existing project.

Please help with the correct syntax. 

Frank Sieweke 1 vote
Comment actions Permalink
1
Avatar

I found out the correct syntax. When updating 'insertQuery' must not be empty but carry the ID of the existing entity.

The request

{
    "insertEntity": {
        "Id": "/Project/5avjomandmtdub42sclqsvl6f78"
    },
    "updateEntity": {
        "Id": "/Project/5avjomandmtdub42sclqsvl6f78",
        "Name": "TEST FS API Queries and Updates"
    }
}
 
led to the expected update and responded
 
{}
 
with status 200.
Frank Sieweke 1 vote
Comment actions Permalink