Error 400 attaching json file

I'm using POST to "/task/<id>/attachments" to attach a file to a task.

When that file is JSON data, with content type "application/json", the response is error 400 Bad Request with the following error description:

"Parameter `<first key in json object>` is not allowed"

I can work around this by massaging the content type to be "text/plain", but it would be nice if I didn't have to add a special case for json data.

Is there json that is allowed to be posted to "/task/<id>/attachments"? What does that do?

By the way, the use case here is for bug reports. The task is a bug report, and I'm trying to attach relevant input (the json file) for recreating the issue being reported.

0
1 комментарий
Spot On Innovative Approach Stellar Advice
Avatar

Michael Cornelius, let's try to fix the request. To add the JSON file via API, no additional parameters are required, but please make sure that there is the 'X-File-Name' Header and the file is added in the request Body. Do so by choosing the binary format and select the JSON file from the local storage:

Check the example Request on Wrike Developers portal and this cURL example below:

Let us know the results!😉

Lisa K. Community Team at Wrike Wrike Product Manager Узнайте о самых популярных функциях Wrike и советах по его использованию

Lisa K. Wrike Team member Узнайте о самых популярных функциях Wrike и советах по его использованию

0
Действия с комментариями Постоянная ссылка

Folllowing List for Post: Error 400 attaching json file
[this list is visible for admins and agents only]

Вверх
Didn’t find what you were looking for? Write new post