In this post, we’ll explore how to leverage Epicor’s REST API to interact with Business Activity Queries (BAQs). By the end, you’ll know how to set up a BAQ for REST access, test it via Epicor’s REST Help page, and use tools like Postman to execute GET requests.
If you haven’t already, go check out our last episode from this series!.
1. Setting Up the environment for REST Access and BAQ permissions
First, ensure your environment is REST-enabled. To do this:
- Create an Access Scope, if you haven’t already, to do this you have to go to the Access Scope Maintenance form (System Setup>Security Maintenance), put an ID and a description to it and save it.
- Add the required permissions, to do that you have to confirm that “Erp.BO.BAQSvc” is added on the services list, and on the BAQs list, the BAQ that you want to use.
- Create a API Key, if you haven’t already, to do this, you have to go to the API Key maintenance form (System Setup>Security Maintenance), and fill all the required fields and using the Access Scope that we setup earlier. NOTE: remember that if you just created the key, you have to save it on another safe place because this is the only time Epicor will show it, after that you can only regenerate it (Actions>Regenerate Key).

2. Accessing the REST Help Page
Epicor provides a REST Help page that’s extremely useful for testing your queries. To access it:
- Open your browser and go to:
https://YourEpicorServer/YourAppServer/api/help/v2/
- Navigate to the
BAQSvc
section where you’ll find some useful recommendations and a search bar. - Use the search bar to confirm your BAQ and then press the “Get Help” submit button.

From here, you can see the structure of your BAQ, check available operations (GET, POST, etc.), and even test it directly.
3. Testing Your BAQ with Postman
For more extensive testing, Postman is a great tool. Follow these steps:
- Set Up the Request:
- In Postman, create a new GET request.
- The URL will look something like this:
https://YourEpicorServer/YourAppServer/api/v2/baq/YourBAQName
- Authentication:
- Set up Basic Authentication or OAuth, depending on your Epicor configuration.
- Sending Parameters:
- If your BAQ requires parameters, append them as query parameters in the URL, e.g.,
?ParameterName=Value
.
- If your BAQ requires parameters, append them as query parameters in the URL, e.g.,
- Execute the Request:
- Click “Send” and review the response in JSON format.
4. Parsing and Using the Data
Once you receive the data, you can parse it in your application for further processing. The JSON response is structured and can be easily integrated into your existing systems by doing the normal GET request as we did in postman.
Conclusion
Using Epicor’s REST API with BAQs opens up new possibilities for integration and data retrieval, making your applications more powerful and flexible. Be sure to stay tune at our news section for next episodes!.