REST API, BeMap Authentication process#
API end points#
The available host environments:
- For Production environment use
https://bemap-prod.benomad.com/bgis/. - For Preproduction environment use
https://bemap-preprod.benomad.com/bgis/. - For testing with the latest version of BeMap use
https://bemap-beta.benomad.com/bgis/. - If you host BeMap on your own work station use
https://localhost:8380/bgis/.
The available protocol end points:
- For Service REST API is
https://[environment]/bgis/service. - For WMS protocol is
https://[environment]/bgis/wms. - For BND protocol is
https://[environment]/bgis/bnd.
Authentication#
The authentication can be provided by URL encoding with appid and appcode parameters or by the Authorization field of HTTP protocol.
By HTTP protocol and Authorization header#
Add the Authorization field in the header of your HTTP request with the value "Basic <account:apikey>". The <account:apikey> string must be encoded in Base64.
Example:
- The
accountis "Aladdin" and theapykeyis "OpenSesame". These two strings are concatenated with:like "Aladdin:OpenSesame". - The string "Aladdin:OpenSesame" can now be encoded in Base64. Example "Aladdin:OpenSesame" → Encoding Base64 → "QWxhZGRpbjpPcGVuU2VzYW1l".
- Now the HTTP header
Authorizationcan be added to your request. Example:Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l.
By Auth API#
- Perform the authentication by calling the API auth and the HTTP header
Authorization:https://[environment url]/bgis/service/acl/1.0/auth - The API returns the HTTP header
X-Auth-IDin response. - Put the HTTP header
X-Auth-IDwith the value (previously obtained) in the request header to call the REST APIs.
By Form#
- Perform the authentication by calling the API
https://[environment]/bgis/loginin HTTP POST method and the HTTP headerContent-Typewith valueapplication/x-www-form-urlencoded. and the form datausername=<your account>,password=<your apikey>andsubmit=Connection. Example:username=Aladdin&password=OpenSesame&submit=Connection - Get the cookie
SESSIONvalue in the reponse. - For next requests, set the cookie
SESSIONwith the kept value in the HTTP cookie header.
By request URL#
WARNING: This solution is deprecated, prefer the authentication API above.
- Set the value of HTTP header
Content-Typetoapplication/x-www-form-urlencoded. - Use the URL:
https://[environment url]/bgis/bnd?appid=[login]&appcode=[password]&[and request parameters...].
Reuse authentication session ID#
To avoid the authentication process for next requests, follow the solution below.
By HTTP header X-Auth-ID#
To avoid the authentication process for next requests, you can use the HTTP header X-Auth-ID.
- See the process chapter Authentication → By Auth API to get the
X-Auth-IDvalue. - Put the HTTP header
X-Auth-IDwith the value (previously obtained) in the request header to call the REST APIs.
By Cookie#
To avoid the authentication process for next requests, you can use the cookie SESSION.
- See the process chapter Authentication → By Form to get the cookie
SESSIONvalue. - For next requests, set the cookie
SESSIONwith the kept value in the HTTP cookie header.