Now it seems I have an chicken / egg problem. I can’t pass in a company ID in the URL because I don’t know the company ID… and I can’t get a list of companies cause all the rest calls require a company be passed in.
Am I missing something obvious? How would I login or make any calls for the first time in an App if I don’t know the Company ID before hand. There should be a way to get a list of Companies out of the system without having a pre-existing company ID… no?
Think App that doesn’t know anything about your system before hand (app store app)
I suppose I could prompt the user to type it, but I will eat my hat if you can find regular users who on average know their company ID… or what a company ID is…
@Doug.C you would have to have a Username and password and API key to Epicor
And I would hope it would return a list of companies which the current is user is authorized to see only.
But currently there is (as far as I can tell) zero way to “Login” or do anything in Rest V2 without knowing the Company ID before hand.
Epicor’s own EMWW prompts you for username / password then it gives you a dropdown of companies to select from (though it uses V1)
It does it in V1 Mark, in V2 it asks you to provide a company ID.
However @Olga just gave us the answer. It is the global services, it requires configuration on the server side. Set an AppSetting flag in the web.config but you can list specific services that can be “pinged” without a company.
In my defense I didn’t think that such a thing existed in the documentation. It is pretty obscure… However Epicor has come a HUGE way in their documentation and I should remember that. hat tip
In the first place. Don’t use global services hack for the company bound services (e.g. for the CompanySvc). This feature is for infrastructure services (e.g. helthcheking).
To get list of companies (AFAIR available for the current user) try to call https://<URL>/<Instance>/api/v2/environment