Method is an action, which is performed when API Request is sent to the server. To create one do the following steps:
Navigate to API Providers (RED MARK) section on the Side Top Menu of Mobsted platform
Select the API providerprovider (RED MARK), for which you want to create API method
In the pop up opened go to the API Provider Methods tab tab (RED MARK)
Click Create new API Provider MethodMethod (ORANGE MARK)
Fill in the following fields (RED MARK):
- Api Provider Method Name
- Method - select one of the available HTTP request methods (GET, POST, PUT, DELETE)
- Endpoint URL
- Consumes Type - select the data type used when sending the API request
- Produces Type - elect select the response type to the request sent by the API
- Parameters - create the required and optional parameters for your API method
Most API queries must contain a number of parameters.
To create a parameter, click the Add Parameter button. (RED MARK)
In the pop up opened fill in the following fields :
...
Click Save Parameter. If the API method should contain several parameters, then repeat the above steps.
Click Save API Provider Method
Click Close to return to API Provider settings.
Optional step
To use the API method's response in your Mobile App ( Data references in app ) you can add one or several responses.
Let's see an one example
Your API method provide these responses:
Click Add New Response
Fill in the following fields (RED MARK):
- Response name
- Response type
- Response text
Click Save
Now this response and data in response text will be available in your Mobile App