mu.semte.ch services use JSON:API. For a more detailed overview of how JSON:API works, see their documentation, but this page will list and explain some examples relevant to our application.



Our resources

road-sign-concepts

Based on the dataset from the app-mow-registry repository. Contains all types of traffic signs, with a board code, description and picture.

road-sign-instances

Actual real-world instances of road signs. References the road sign type (from above), the sign's location and some other metadata.

Working with our resources

Creating a resource

To create a resource, you must send an HTTP POST request to domain.name/[resource], in the following format:

{
	"data": {
		"type": "[resource]",
		"attributes": {
			"[attribute]": "value"
		},
		"relationships": {
			"[relationship-name]": {
				"data": {"type": "[other-relationship-name]", "id": "[other-relationship-id]"}
			}
		}
	}
}

A quick way to send these requests from the commandline is using curl.

If you have a file query.json with the JSON:API query inside of it, you can use this command to create a new resource:

cat query.json | curl -X POST -H Content-Type:application/vnd.api+json -H Accept:application/json -d@- <http://localhost:8000/[resource]>

In practice you would probably use something like Ember Data, but this can be useful for testing during development.

Creating a new height