Property Management API Requirements
Obtaining Authorization Token Required for All Property Management APIs
The first property management API that you must run is to authenticate that you are a registered user for a specified management portal. If successfully authenticated, the response body provides a Json Web Token (JWT) to use in the Authorization header of all property management APIs for this specific management portal. (You will not be using the token generated from the core Cloudpath APIs.)
Follow the steps below to generate the required token:
- Set up the the property
management API to log in to the management portal:
- Create the URI by using
the format:
https://<Your_Cloudpath_System>/admin/rest/propertyMgmtPortals/<Management-Portal-GUID>/token
Replacing the bold values with actual values, an example API to log in is:
https://Jeff245.cloudpath.net/admin/rest/propertyMgmtPortals/MduPortalAccess-79293a33-262c-415b-8f0c-98ebc01eb503/token
Where:
- https://Jeff245.cloudpath.net/admin/rest/propertyMgmtPortals is the root URI of the Cloudpath system being used (must include https, as shown)
- MduPortalAccess-79293a33-262c-415b-8f0c-98ebc01eb503 is the GUID of the management portal to be authenticated against. The token is valid for actions on this specific portal only.
- Use a POST call.
- In the Request Body,
enter the user's email and the secret of the management portal, as in
the following example:
{ "userName":"js@ltapts.com", "password":"secret" }
- Create the URI by using
the format:
- For Request headers, you need:
Note: The Authorization in the Request header for this POST must be a token that was generated from the core APIs, as described in Security.
Request Header
Key Value Content-type application/json Authorization eyJhbGciOiJIUzUxMiJ9.eyJhY2NvdW50UGsiOiIxIiwicm9sZVBrIjoiMjAwMDAiLCJhdWQiOiJSRVNUX0FQSSIsInN1YiI6IjEiLCJpc3MiOiJueEo5REV6aG1XUGJlSVZGaGR4Wm44cnh6aFhlR1AycmpOVHJxYndqSnhRPSIsImlhdCI6MTYyODkwNjg3NSwiZXhwIjoxNjI4OTA3MTc1fQ.-JMu3ybf6r547AJozgcs3eUiEoleTvuRmi2y24f8Qrvs4q_Ej1PXOz3ZowmvWSs4AS5gswPrptvHsZLhU9ZHGg - Send the request.
Once the request is sent, you will receive a "Status: 200 OK" if the POST is successful. The response body provides a token. You will need to generate a new token each time the current ones expires. You need to use the active token from this response in the Authorization header on all property management APIs.
{ "userName": "js@ltapts.com", "token": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJMYWtlIFZpZXcgQXBhcnRtZW50cyBNYW5hZ2VtZW50IFBvcnRhbCIsInBvcnRhbEd1aWQiOiJNZHVQb3J0YWxBY2Nlc3MtNzkyOTNhMzMtMjYyYy00MTViLThmMGMtOThlYmMwMWViNTAzIiwiYWNjb3VudFBrIjoiMSIsInVzZXJFbWFpbCI6ImplZmYucmhvZGllQGNvbW1zY29wZS5jb20iLCJwb3J0YWxTZWNyZXQiOiJzZWNyZXQiLCJpYXQiOjE2Mjg5MDcwOTQsImV4cCI6MTYyODkwNzM5NH0.F_h48OPwUI_F1KDFNpz8zFM1qQzbxyG5KrLyc7HR7IE", "expireDateTime": "2021-08-14T02:16:34Z" }When grabbing the token, do not take the quotation marks. In the example above, you would grab the token as follows for using it in the Request Authorization header on a property management API:
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJMYWtlIFZpZXcgQXBhcnRtZW50cyBNYW5hZ2VtZW50IFBvcnRhbCIsInBvcnRhbEd1aWQiOiJNZHVQb3J0YWxBY2Nlc3MtNzkyOTNhMzMtMjYyYy00MTViLThmMGMtOThlYmMwMWViNTAzIiwiYWNjb3VudFBrIjoiMSIsInVzZXJFbWFpbCI6ImplZmYucmhvZGllQGNvbW1zY29wZS5jb20iLCJwb3J0YWxTZWNyZXQiOiJzZWNyZXQiLCJpYXQiOjE2Mjg5MDcwOTQsImV4cCI6MTYyODkwNzM5NH0.F_h48OPwUI_F1KDFNpz8zFM1qQzbxyG5KrLyc7HR7IE
Root API
The root for all property management APIs is as follows:
<Cloudpath FQDN>/admin/rest/propertyMgmtPortals/{guid}
where {guid} is replaced by the unique identifier of a configured management portal.