Unsupported Media Type when using the import API although I specified the Content-Type header
I'm trying to import users into YouTrack using the REST API in JSON format.
I set the Content-Type header to "application/json", the Accept header to "application/json" and the Authorization header with my bearer token.
But I'm still getting a 415 error with message "Unsupported Media Type".
Any idea what I might be missing?
Please sign in to leave a comment.
Could you please try without accept-header, just content-type?
I get the exact same result, except the error message is in XML instead of being in JSON.
Could you please provide the full request (with body and headers)?
request url:
https://adessa.myjetbrains.com/youtrack/rest/import/users?test=true
request headers:
Content-Type: application/json
Authorization: Bearer xxxx
request body:
[{"login":"sarbogast","fullName":"Sebastien Arbogast","email":"sebastien.arbogast@gmail.com"}]
Unfortunately, this method only supports XML format, I'm sorry.