Standard Procedure
Generally, the Bim+ REST API calls consist of three steps for accessing the resources.
1. Send a request for the authentication token|#Tools.
2. Receive the authentication token.
3. Use the token for making the API request for any resource.
1. Authentication token request
The authentication request for accessing the BimPlus resource should be sent in the JSON format using the Authorization service.
Deck of Cards |
---|
|
Card |
---|
label | Implementation Status |
---|
| Service available ! |
Card |
---|
label | URL / Resource / Parameters |
---|
| Resource: authorize URL: https://api.bimplus.net/v2/authorize |
Card |
---|
| Authenticates a user and returns a token which can be used for further API calls for accessing the desired resources. |
Card |
---|
| Code Block |
---|
borderColor | Green |
---|
title | Headers |
---|
|
Content-Type: application/json
|
Code Block |
---|
| {
"user_id" : "test@bimplus.net",
"password" : "test"
} |
|
Card |
---|
| Code Block |
---|
borderColor | Green |
---|
title | Status |
---|
|
Status: 200 OK
|
Code Block |
---|
| {
access_token: "9c1874a62c974dcfa75e0132c423a088"
expires_in: 2591999
token_type: "BimPlus"
} |
|
|
2. Receive the authentication token
The token is received in the request.
Deck of Cards |
---|
|
Card |
---|
label | Implementation Status |
---|
| Service available ! |
Card |
---|
label | URL / Resource / Parameters |
---|
| Resource: authorize URL: https://api.bimplus.net/v2/authorize |
Card |
---|
| Authenticates a user and returns a token which can be used for further API calls for accessing the desired resources. |
Card |
---|
| Code Block |
---|
borderColor | Green |
---|
title | Headers |
---|
|
Authorization: BimPlus c939ebf5b96646528e0022a35f7a2e67
Content-Type: application/json
|
Code Block |
---|
| {
"user_id" : "test@bimplus.net",
"password" : "test"
} |
|
Card |
---|
| Code Block |
---|
borderColor | Green |
---|
title | Status |
---|
|
Status: 200 OK
|
Code Block |
---|
| {
access_token: "c939ebf5b96646528e0022a35f7a2e67"
expires_in: 2591999
token_type: "BimPlus"
} |
|
|
3. Request the desired resource
Using the authentication token, the necessary resource can be accessed and the desired action can be performed on that resource using the BimPlus REST API.
For example, we can use this token to get the project list.
Deck of Cards |
---|
|
Card |
---|
label | Implementation Status |
---|
| Service available ! |
Card |
---|
label | URL / Resource / Parameters |
---|
| Resource: projects URL: https://api.bimplus.net/v2/<company>/projects Example: https://api.bimplus.net/v2/bimplus/projects |
Card |
---|
| Get available project list with main properties. |
Card |
---|
| Code Block |
---|
borderColor | Green |
---|
title | Headers |
---|
|
Authorization: BimPlus c939ebf5b96646528e0022a35f7a2e67
Content-Type: application/json
|
|
Card |
---|
| Code Block |
---|
borderColor | Green |
---|
title | Status |
---|
|
Status: 200 OK
|
Code Block |
---|
| [3]
0: {
id: "c8c8e6f2-4495-484c-929d-0049f1f9d4ff"
name: "!!!!!_VORTEILSHAUS V40 SD45 Traufeingang"
}-
1: {
id: "2d703abe-b4f9-407c-af53-a39c5b7ba872"
name: "__5 999 Parklife Salzburg Lehen"
}-
2: {
id: "c480cc54-aec4-4bef-8d35-93bb090e1aba"
name: "0811-Wohnhaus Kraus - Carport1"
} |
|
|
Plugins for doing REST based calls (REST Client)
Chrome --> Advanced REST client, Postman - REST client, Simple REST client
Firefox --> RESTClient
For validating or formatting JSON --> http://jsonlint.com/