Retrieve Data from MaintainX
Platform: | WebMobile |
---|---|
Plan Type: | BasicEssentialPremiumEnterprise |
User Type: | RequesterFull UserAdministrator |
Besides creating or updating data in MaintainX, Zapier can also retrieve data from MaintainX to use in later steps of your workflow.
You can retrieve MaintainX entities using Zapier's Find Entity action, or using custom requests.
Use the Built-In "Find Entity" Action to Retrieve MaintainX Data​
Zapier has a Find an Entity action for MaintainX that you can use to look up the following entities:
- Work orders
- Users
- Locations
Set Up the Find Entity Action​
When you add an action to a Zap in Zapier:
- When you select the App for your action, choose MaintainX.
- In the Setup options, set Action event to Find an Entity.
- In the Configure options, select the Entity Type to retrieve (e.g. Work Order).
- Select the Field to use to find the Entity to specify how the entity will be found (e.g. dynamically by the ID).
The Zap will now search for the entity using the method you specified. You can use the fields it returns in later steps in the Zap.
Use Custom Requests to Retrieve MaintainX Data​
If you need access to MaintainX fields that aren't available through the built-in Find Entity action, you can use a custom GET request for any of the MaintainX API's GET endpoints.
For endpoint details, see the MaintainX API documentation.
Set Up a Custom Request​
When you add an action to a Zap in Zapier:
-
When you select the App for your action, choose Webhooks.
-
In the Setup options, set the Action event to Custom Request.
-
In the Configure options, set the following:
Field Value Method GET URL The MaintainX Endpoint URL.
For example, the URL for the Create new work order endpoint ishttps://api.getmaintainx.com/v1/workorders
To find the URL for the endpoint you want to use, consult the MaintainX API Documentation. -
In the Headers section, add the following headers:
Header Value Authorization
Bearer <your API key>
Content-Type
application/json
-
In the Test options, test your custom request.
Use the MaintainX API Documentation to troubleshoot any error codes you receive.
Example: Look Up a Work Order​
This example shows you how to use the Get Work Order endpoint to retrieve a work order from MaintainX based on its ID.
Configuration:
Field | Value |
---|---|
Method | GET |
URL | https://api.getmaintainx.com/v1/workorders/{{workOrderId}} |
Query Parameters:
Some endpoints allow you to filter or expand data using query parameters. You add the parameters to the end of a URL using a question mark (?
), followed by key/value pairs joined by ampersands (&
).
For example, adding these parameters to the URL ensures that the API response includes details about assignees and assets.
?expand=assignees\&expand=asset
In that case, the full URL becomes:
https://api.getmaintainx.com/v1/workorders/{{workOrderId}}?expand=assignees&expand=asset
Example: List Work Orders​
This example shows you how to use the List Work Orders endpoint to retrieve a list of work orders from MaintainX.
Configuration:
Field | Value |
---|---|
Method | GET |
URL | https://api.getmaintainx.com/v1/workorders |
Handling multiple pages of data:
When you retrieve lists from MaintainX, the data will be limited to a set number of items. To fetch the next page of data, you have to configure your Zap to check each page of the response.
The nextCursor
value returned in the API response is the cursor for the next page of data.
To fetch that next page of data, send another request and include cursor={{nextCursor}}
in the request URL.
https://api.getmaintainx.com/v1/workorders?cursor={{nextCursor}}
You can repeat this process until nextCursor
is null, in which case no further pages of data exist.