Introduction:
This is guide describes how to edit an API GET request to filter for information such as email or name. This is a followup guide to our API docs as merchants may not know how to add additional parameters to the template requests we put. https://api.smartrr.com/docs/redoc/#tag/Customer/paths/~1vendor~1customer-relationship/get
Prerequisites:
- Postman
- Smartrr API Docs
- Filter parameters
Steps:
- Open up your Postman (or similar application for API testing)
- Import an example URL that appears in the Smartrr API Docs. The URL below is looking for information from our local dev store in the customer relationship
https://smartrr-dev.local.com/vendor/customer-relationship
- Change your request to a GET request.
- Replace smartrr-dev.local with the environment that you want to call the API from. If it’s from the production, replace it with api.smartrr.com. If it’s staging, use api.staging.smartrr.com. Replace ‘customer-relationship’ with the appropriate endpoint. If you want to add filters, add a ? and the correct query parameters afterwards.
- Edit your request to narrow down your search results. The different query parameters are listed below:
- orderBy:
- filterEquals:
- filterLike:
- pageSize & pageNumber:
Example
This example is a get request to Smartrr API’s purchase state. We are filtering by page size = 5 (how many you want per request/size of page) and page number = 0 (index of the pages) as well as where email or name is equal to rytis.tekorius@gmail.com.
GET - <https://api.smartrr.com/vendor/purchase-state?pageSize=5&pageNumber=0&filterLike[emailOrName]=rytis.tekorius@gmail.com>
Conclusion:
This guide teaches you how to format an API get request!