Hello, I’ve been getting the following error since Sunday when using the Node SDK. It seems like this is only happening on requests which result in a PUT or POST request under the hood as calls like listCards
or listLocations
are working, however searchTeamMembers
or obtainToken
are throwing the following error:
STATUS 400
{
code: 'BAD_REQUEST',
detail: 'Expected "{" (line 1, character 1)',
category: 'INVALID_REQUEST_ERROR'
}
An example of a call through the SDK which is currently failing:
client.teamApi.searchTeamMembers({})
Further notes:
After checking the API logs I noticed that when the POST requests started failing the requests which the SDK was actually sending changed from an object to a string
Failed Request Example: (search catalog objects)
content-length: 42
content-type: application/json
square-version: 2021-08-18
accept: application/json
user-agent: Square-TypeScript-SDK/13.1.0
"{\"query\":{\"filter\":{}},\"limit\":25}"
Successful Request example from a few days ago:
User-Agent: Square-TypeScript-SDK/13.1.0
Accept: application/json
Content-Length: 198
Square-Version: 2021-08-18
Content-Type: application/json
{
"object_types": [
"ITEM"
],
"include_deleted_objects": false,
"include_related_objects": false,
"query": {
"exact_query": {
"attribute_name": "image_id",
"attribute_value": "DX2PPNM7OTCQKVOM3RNYZEUX"
}
},
"limit": 1
}