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?

0
5 comments
Avatar
Liubov Melnikova
Official 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.

0
Avatar
Liubov Melnikova

Could you please provide the full request (with body and headers)?

 

 

0

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"}]

0
Avatar
Liubov Melnikova

Unfortunately, this method only supports XML format, I'm sorry.

0

Please sign in to leave a comment.