Make an API request
The Mobilic API is a web service (based on the HTTP protocol) that uses the GraphQL standard.
GraphQL
Unlike REST architectures where the HTTP verb and the URI will characterize the operation, all requests to the GraphQL API will share the same HTTP POST verb and the same URI.
This unique URI depends on the environment:
The details of the operation will be specified in the JSON body of the request.
A basic example
All actions that can be performed on the API require to have created a Mobilic account, and almost all require to be authenticated.
For this basic example, we will take an operation that displays the email, the name, and the Mobilic ID of the user, using the operation me
The body of the query, in JSON format, must contain a query field that specifies the operation. The value of this field query is for the operation me:
query {
me {
id
lastName
email
}
}To build the JSON body of the query, simply put the text of the operation in a string, escaping quotes with backslashes and replacing the line breaks with :
To submit the request to the API it is possible to use :
the console for an interactive experience. See the console guide.
any HTTP library (
curl, pythonrequests,...)
Via cURL
You just have to build the JSON body of the request from the query field :
For more information on how to write GraphQL operations you can consult our guide on GraphQL operations.
Last updated
