lxHive
lxHive copied to clipboard
PUT to /activities/state responds with "Cannot merge!"
PUT requests to /activities/state does not function properly. When sending a PUT request with a new activity ID, the response is:
{
"code": 400,
"message": "Original document is not JSON. Cannot merge!",
"data": []
}
A GET request with the same parameters gives an empty body response with a status of 200.
My understanding is that PUT requests should not attempt to merge documents, so I am not sure of the source of this issue.
An example PUT request:
PUT /activities/state?activityId={{activityID}}&agent={{agentJSON}}&stateId=http%3A%2F%2Ftincanapi.co.uk%2Fstateapikeys%2Fregistrations HTTP/1.1
Authorization: Basic ~~~
Content-Type: application/json
User-Agent: PostmanRuntime/7.29.0
Accept: */*
Postman-Token: 8f3bc466-20cc-4a48-8e54-7209f0decb46
Host: vrcmt-lms:81
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 158
{
"83e37870-eacc-42eb-af33-3d9d32ba65c5": {
"created": "2022-06-23T17:28:40.296Z",
"lastlaunched": "2022-06-23T17:28:40.296Z"
}
}
HTTP/1.1 400 Bad Request
Date: Thu, 23 Jun 2022 17:28:08 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.3.33
X-Powered-By: PHP/7.3.33
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST,PUT,GET,OPTIONS,DELETE
Access-Control-Allow-Headers: Origin,Content-Type,Authorization,Accept,X-Experience-API-Version,If-Match,If-None-Match
Access-Control-Allow-Credentials-Control-Allow-Origin: true
Access-Control-Expose-Headers: ETag,Last-Modified,Content-Length,X-Experience-API-Version,X-Experience-API-Consistent-Through
X-Experience-API-Version: 1.0.3
X-Experience-API-Consistent-Through: 2022-06-23T17:28:09+00:00
Content-Length: 79
Connection: close
Content-Type: application/json;charset=utf-8
{"code":400,"message":"Original document is not JSON. Cannot merge!","data":[]}
An example GET request:
GET /activities/state?activityId={{activityID}}&agent={{agentJSON}}&stateId=http%3A%2F%2Ftincanapi.co.uk%2Fstateapikeys%2Fregistrations HTTP/1.1
User-Agent: PostmanRuntime/7.29.0
Accept: */*
Postman-Token: ab358c40-6003-42e4-8495-766cf5503db8
Host: vrcmt-lms:81
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
HTTP/1.1 200 OK
Date: Thu, 23 Jun 2022 17:28:01 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.3.33
X-Powered-By: PHP/7.3.33
ETag: "da39a3ee5e6b4b0d3255bfef95601890afd80709"
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST,PUT,GET,OPTIONS,DELETE
Access-Control-Allow-Headers: Origin,Content-Type,Authorization,Accept,X-Experience-API-Version,If-Match,If-None-Match
Access-Control-Allow-Credentials-Control-Allow-Origin: true
Access-Control-Expose-Headers: ETag,Last-Modified,Content-Length,X-Experience-API-Version,X-Experience-API-Consistent-Through
X-Experience-API-Version: 1.0.3
X-Experience-API-Consistent-Through: 2022-06-23T17:28:01+00:00
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/plain;charset=UTF-8