Hello,
I am experiencing an issue with the NodeSDK, whenever I apply any data shape, to boxClient.folders.addMetadata() it throws a 400 with “message”: “Request contains invalid parameters.”, If I apply a empty object {}, it works without issue. (So I know that i am able to connect, and have permissions ect)
The shape of the metadata template is:
The relevant code:
const metadataValues = {
ENTITY_ID: “1234”,
is_Active: “1”,
is_Found: “1”,
};
let response_metadata_applied = await this.boxClient.folders.addMetadata(folder_id, “enterprise_534608”, “ciptemplate”, metadataValues);
It throws a 400, with that error.
If I apply
let response_metadata_applied = await this.boxClient.folders.addMetadata(folder_id, “enterprise_534608”, “ciptemplate”, {});
It works 100%, but the values are of course empty.
I have tried all methods of controlling the body: when I look at the error response
{
“statusCode”: 400,
“response”: {
“statusCode”: 400,
“body”: {
“message”: “Request contains invalid parameters.”,
“code”: “bad_request”,
“request_id”: “ic7oqbhkrlg85i9k”
},
…(bunch of stuff)
“body”: “{"ENTITY_ID":"1234","is_Active":"1","is_Found":"1"}”
}
When I toss that body thru a JSON.parse it comes out ok.?!
Is there something obvious I am missing? My code is almost identitical the code used on the example page: https://developer.box.com/reference/post-folders-id-metadata-id-id/
What am I missing, I know its related to the body the metadataValues I am passing? What’s the secret sauce I am missing.
Thank you,
Andrew