Getting Started with MAP API
1. What is MAP API
MAP API is the communication protocol for communicating with your MAP Cloud from third-party components. It is based on the REST protocol to perform operations on the cloud in a few simple steps.
Main features:
- Easy to use
- Cross-platform support. Can be integrated into many programming languages (.NET, JAVA, SWIFT, PHP and more)
- Based on http protocol (GET / POST request)
- JSON Response
- Flexible authentication (Cookie or TOKEN Key)
2. Using MAP API
Step1. Find a rest client or http client for your project. Here are some examples:
- .NET
- RestSharp: REST API client library for .NET.
- HttpClient: REST API client library for .NET.
- PHP
- Requests for PHP: HTTP library written in PHP.
- cURL: Native PHP request library.
Step2. Identify base url request
To communicate with the API you need the complete link of your cloud with which to interact.
For example:
https://master.instanteat.it/
Step3. Add Request
For every request, add its path to base url.
For example for Encode string to MD5 the path is Admin/Utility/EncodeStringAsMd5
. The full link will then become this:
https://master.instanteat.it/Admin/Utility/EncodeStringAsMd5
Step4. Execute request
Now you can add request params with GET or POST method.
Warning
Remember to add the eResponse
field (With value 1) to the parameters to get the response in JSON format.
For example we want to encrypt the word HELLO
.
To do this we need to add our word to the csPlainString
parameter. The request will become (GET Request):
https://master.instanteat.it/Admin/Utility/EncodeStringAsMd5?csPlainString=HELLO&eResponse=1
This is JSON response:
{
"Status":0,
"StatusMessage":"SUCCESS",
"MD5String":"EB-61-EE-AD-90-E3-B8-99-C6-BC-BE-27-AC-58-16-60"
}
3. Response status
Each response contains 2 parameters:
- Status: The operation status as integer (
0
for for successful operations) - StatusMessage: The operation status as string (
SUCCESS
for for successful operations)
4. Authentication & Access Token
For security reasons, some API methods may require authentication.
MAP API offers 2 authentication systems so you can use them according to your needs.
Cookie based (Session Id)
This method stores a key in cookies in order to maintain authentication and make various requests.
Before making requests, you must first login request (We will see it later).
Note
This method requires Keep Alive AND saving cookies
TOKEN based
This method requires you to pass your TOKEN in the request parameters. For Example:
https://master.instanteat.it/{METHOD_NAME}?TOKEN={MY_TOKEN}
5. Plugins
In addition to having the main core MAPWEB, MAP is divided into several plugins. Each of which offers different features searchable via MAP API.
To query the plugin methods just add the plugin name in the request url.
For example for the MPPersonWeb
plugin:
https://master.instanteat.it/Admin/MPPersonWeb/Home/Person?csIdName=Oid&csIdValue=1&eResponse=1
6. Tutorials
MAP API tutorials are available at this address: MAP API tutorials
7. Full API references
All MAP API references are available at this address: MAP API references