1. What is the issue? Please be detailed.
Trying to access Odata via the api URL in the documentation:
GET /v1/projects/{projectId}/forms/{xmlFormId}.svc
I filled in the project ID (4) and the xmlFormId (test1).
The result is:
{"message":"Requested format not acceptable; this resource allows: application/json,json.","code":406.1,"details":{"allowed":["application/json","json"],"got":"text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"}}
I am authenticated as administrator.
Without the '.svc' at the end, the api works and displays what it has to display.
2. What steps can we take to reproduce this issue?
Go to the same URL with a valid project id and form Id
3. What have you tried to fix the issue?
Searching this forum
4. Upload any forms or screenshots you can share publicly below.
The .svc endpoint returns JSON and the request must include either application/json or json in its Accept header.
The service document is valuable for systems like Excel or PowerBI that implement the OData standard. If you're trying to use the data in your own system, you may be best served by skipping the service document and going straight to the data document for your submissions and repeats.
What are you using to make requests? If you're using R or Python, consider using ruODK or pyodk to take care of those details for you.
As a side note, I sometimes like to view the OData documents in my browser. I use a browser extension to set the Accept header to do that.
ruODK parses the submissions into native R data types by inspecting the form schema.
The form schema endpoint used to return an XML document which was quite a handful of work to parse (at least for my limited R skills) that I decided to turn that into an R package so that no other human should have to repeat this. The new JSON format for the form schema is much easier to parse!
Still, you'll need to introspect field types to work with them, and pyODK or ruODK do the heavy lifting for you there.