The purpose of this article is to provide information regarding the use of RESTv1. See the API documentation for up-to-date reference.
Table of contents |
---|
Agencies
POST Agency
When using the agencies POST, the agencyType
and name
fields are mandatory. The agencyType
should always match that of the parent (the agency that belongs to the authenticated user).
Before running this request, make sure valid amelia credentials are being provided or the request will fail with 401 Unauthorized
.
Note:
Ensure in your Request Properties, Encoding is set to UTF-8.
1) Get the agency for the user currently logged in. | GET /agencies |
2) From the above response, retrieve the agency type and name information. This is the minimum amount of information required for the POST action to succeed. | |
3) Take the information retrieved from the above response and use it as the request body for the POST operation. | POST /agencies |
Sample request: Error rendering macro 'code': Invalid value specified for parameter 'lang'{ "agencyType": { "key": "akMHFjtgGEGcS9LRfawjCw==", "name": "Booking sample" }, "name": "InteliSys Booking" } | Sample response: Error rendering macro 'code': Invalid value specified for parameter 'lang'{ "href": "/agencies/t2MkLBokPWOfz6DEMcdjeg==", "key": "t2MkLBokPWOfz6DEMcdjeg==", "iataNumber": "", "name": "InteliSys Aviation Systems" } |
GET Agency
1) If no key is provided, the agency for the user you are logged in as will get returned. | GET /agencies |
2) The agency key from this response can then be used for subsequent operations. | GET /agencies/{key} |
Users
GET User Permissions
1) Get the agency key for the agency the user belongs to. | GET /agencies |
2) Once you have the agency key, you can then get all the users for that specific agency. | GET /agencies/{key}/users |
3) Get the user key for the user whose permissions you wish to check from the response of the above operation. | |
4) You can now get all of the permissions for that user. | GET /users/{key}/effectivePermissions |
| GET /users/{key}/effectivePermissions?descriptorFilter=Reservations |
Check if a User has a Specific Permission
Assuming you have the key for the desired agency:
1) If you do not already know the descriptor name of the permission you wish to check, you can get a list of all permissions. | GET /permissions/descriptorFilter=res |
2) Get the descriptor for the permission you wish to check, get the key for the user you wish to check the permission for. | GET /agencies/{key}/users |
3) You can now check if that specific user has that permission. | GET /users/{key}/effectivePermissions?descriptorFilter={permissionDescriptor} |
Groups
GET Users for a Specific Security Group
1) Get the group key for the desired group. | GET /groups |
2) Once you have the key, you can get all users for that group. | GET /groups/{key}/users |
You can alternatively get all the groups that a user belongs to.
GET Users Groups
Assuming you have the key for the desired agency:
1) Get the desired users key | GET /agencies/{key}/users |
2) Once you have the users, key you can get the groups that the user belongs to. | GET /users/{key}/groups |
Related articles