Epicor API Key Rest - Help Needed

I have created an access scope for two BAQS and have created an API key for that access scope. When I go into Epicor Rest Swagger UI and run either of the BAQS with the API key that I created it works perfectly. However, when I do the same thing in Postman it throws the following error

image

What am I missing when it comes to passing/handling my API key in Postman?

Thanks for the help!

You need to add the API key into either the query params of the call or the header of the call. Here’s a screenshot of adding it as a query param:

3 Likes

Thanks for the quick reply Aaron! After adding in the API key as shown I get a 401 error:

image

You also need to pass the auth, in addition to the api-key

So for v2 it’s going to be API and Auth. You can also set what kind of license you want it to use if you set it in the header with the License key (you can also do this for session if you are building an app that is going to use sessions)

Oh…I thought the point of v2 and API keys was to remove the username and password requirement.

No sir. It does enhance the security though

Okay! After running with a username, pass and API key I get a solid return. Only issue now is that this only seems to return the meta data instead of the data within the requested query:

Also while I have you on the horn can you give me a quick run down on how you utilize Postman? Generally, I just use it to make sure I’m programming in proper query information on C# programs. It seems like this could be a much more useful tool though.

Sure thing! Glad we at least got the plumbing resolved.
Postman is a great tool for testing HTTP calls/responses but your c# program will need to utilize its own HTTP client (i.e. something like RestSharp, HttpClient, whatever you’re comfortable with). Once you get your calls and responses working in Postman, it’s a good time to translate what you’re doing there to your c# program.

It’s also great for documenting your API with sample request and response schemas, etc. You can configure it for multiple environments and hosts. It’s a great prototyping and testing tool.

Regarding getting your metadata only, you need to call the BAQ (in v2) with the /BaqSvc/{BAQID}/Data syntax

3 Likes

Awesome! That context did the trick. Thank you Aaron!!

1 Like