Introduction¶
API format specification¶
Social WiFi REST API 1 format specification is based on JSON:API. Thanks to that you can expect a clean and consistent interface. Please consult the JSON: API v1.0 Specification to learn all the details. This documentation will focus on describing Social WiFi endpoints and resources, while format details should be consulted in the upstream documentation linked above.
Keep in mind
Not all endpoints support all resource operations (create, read, update, delete) and all JSON:API features. For example, if filtering section is missing for an endpoint, please assume that it's not supported at the moment. Similarly, if deleting of a resource is not documented, assume it's not supported.
For production use, we recommend using one of the JSON:API client libraries.
Code examples¶
Although language-specific client libraries exist, the code examples in this
documentation, use the cURL command, which is available for all operating
systems. Thanks to that, the examples are short and readable, so that they can
be easily adapted to other languages and libraries if needed. If using cURL,
we recommend parsing the output with jq tool or similar, which help with
pretty-printing JSON.
Authentication¶
Every endpoint needs an API access token. Please read how to obtain it
here.
If you have an access token, anywhere in the examples you see ${API_TOKEN},
use your token instead.
You first request¶
When you have the API access token, you can try sending your first request.
GET /accounts/filtered-accounts/me/
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
https://api.socialwifi.com/accounts/filtered-accounts/me/ \
| jq
Response
{
"data": {
"type": "accounts",
"id": "99999999-9999-9999-9999-999999999999",
"attributes": {
"email": "john.doe@socialwifi.com",
"full-name": "John Doe",
"confirmed-at": "2012-06-29T20:38:56+00:00",
"language": "en",
"roles-names": [
"STANDARD"
],
"tags": [],
"created-by-id": null
}
},
"jsonapi": {
"version": "1.0"
}
}
-
Strictly speaking, Social WiFi does not implement all REST API constraints, because it does not support HATEOAS. Based on our experience, clients barely use HATEOAS even if it's available. It may be added at a later time, since it's supported by the JSON:API specification via
links. ↩