API URL
https://api.tmpapi.dev/interface[/data-name] is an API endpoint/base URL.
Available interfaces:
- rest
- graphql
For example:
- https://api.tmpapi.dev/rest/lorem-f2188705
- https://api.tmpapi.dev/graphql/lorem-f2188705
An API endpoint selects the element in a JSON structure and accepts a query for retrieval.
Data source
{
"users": [
"@key(id)", "@repeat(2)",
{"id": "%index%", "name": "User %index%", "type": "admin"},
{"id": "%index%", "name": "User %index%", "type": "stuff"}
]
}
Endpoint
https://api.tmpapi.dev/interface/data-name/users
Result
[
{"id": 0, "name": "User 0", "type": "admin"},
{"id": 1, "name": "User 1", "type": "stuff"},
{"id": 2, "name": "User 2", "type": "admin"},
{"id": 3, "name": "User 3", "type": "stuff"}
]
Endpoint
https://api.tmpapi.dev/interface/data-name/users/2
Result
{"id": 2, "name": "User 2", "type": "admin"}
Endpoint
https://api.tmpapi.dev/interface/data-name/users/2/type
Result
"admin"
Check how to query APIs, also response JSON format.