How to complete the challenge GET /todos (406) unsupported +json

This challenge asks for a structured +json media type that the todo endpoint does not support as a normal resource representation.

Issue a GET request on the /todos end point with an Accept header such as application/problem+json or application/*+json to receive 406 'NOT ACCEPTABLE' status code.

Basic Instructions

  • Issue a GET request to /todos
  • Add the X-CHALLENGER header to track challenge completion
  • Set Accept to application/problem+json
  • Check that the response status is 406

Try it now

GET /todos with unsupported problem JSON Accept

Example Request

> GET /todos HTTP/1.1
> Host: apichallenges.com
> X-CHALLENGER: x-challenger-guid
> Accept: application/problem+json

Example Response

< HTTP/1.1 406 Not Acceptable
< Content-Type: application/json
< X-Challenger: x-challenger-guid

The API may still format its error payload as application/json, but that is not the same as returning the requested todo representation.

Lessons Learned

  • application/problem+json is normally an error document media type, not a todo collection representation.
  • application/*+json does not match plain application/json because the plain subtype does not end in +json.
  • Structured media types need explicit endpoint support before they can be used in Accept negotiation.

Suggested Experiments

  • Retry with Accept: application/problem+json, application/json;q=0.5 and confirm that the supported fallback can succeed.
  • Send Accept: application/vnd.apichallenges.todo+json and check whether the API advertises that vendor JSON representation.
  • Compare this failure with Accept: application/*+xml, which can match a supported structured todo XML representation.
Experiment with this endpoint