Urgent - When applying metadata to file i am getting invalid Request contains invalid parameters
Trying to apply metadata to file ,i created a template from the admin console with one metadata field
name of the metadata is test name of field is "recorddateclosed" type text.
request :
{Method: POST, RequestUri: 'https://api.box.com/2.0/files/1152853018167/metadata/enterprise/test', Version: 1.1, Content: System.Net.Http.StringContent, Headers:
{
Authorization: Bearer TaOblEVIgjXXXXXXDu5hw1s4XXXXXjkZ
Content-Type: application/json; charset=utf-8
}}
metadata :
{[recorddateclosed, { Value = 01-01-0001 00:00:0 }]}
scope:"enterprise"
template :"test"
request Id : Result: "{\"message\":\"Request contains invalid parameters.\",\"code\":\"Bad Request\",\"request_id\":\"4dhgkshbkdpueiv0\"}"
-
Hi QA,
I suspect there might be a typo on the attribute key name.
List all templates or just the one your using and check the key value for your recorddateclosed attribute. It might not be what you expect.
For example using postman:
https://{{api.box.com}}/2.0/metadata_templates/enterprise
I get:
{
"id": "548d9254-c7f7-4c34-8898-c9ec1294f705",
"type": "metadata_template",
"templateKey": "customerData",
"scope": "enterprise_877840855",
"displayName": "Customer data",
"hidden": false,
"copyInstanceOnItemCopy": false,"fields": [
{
"id": "ef2c0822-c134-4221-b40c-3bfb14a59c96",
"type": "string",
"key": "customerName",
"displayName": "Customer Name",
"hidden": false
},However on the template administration console:
The attribute name, which is the display name is not the same as the key name.
Let me know if this helps.
-
Hi,
An Thank You for the response, i am entering the correct key and the value is string .
this is how i am adding the value into the metadata that is new Dictionary<string, object>();
var omri = "omri";
var obj =(object) new {omri};
metadataValues.Add(item.Key.ToLower(),obj);What do you think ?
サインインしてコメントを残してください。
コメント
3件のコメント