Hi,
We're migrating from the SOAP API to the Agent Web API and need to get the owner's CompanyId (i.e. company ID associated with the license).
Previously, we able to do it using the SoPrincipal service and its GetSystemInfo method.
Since the SoPrincipal agent for the Web API does not exist, what's the correct way to do it?
All Replies (7)
Hi Dmitry!
You can use the UserAgent.GetCurrentPrincipal() and inspect the Result.ContactOwner.
Hope this helps!
We ended up with retrieving CompanyName from the license info returned by the License agent and then using it with the Archive agent to retrieve the owner's contact ID by its name.
HI Dmitry,
Instead of doing a heavy API call to retrieve the license info, you could use the owner contact archive provider: OwnerContacts
If you specifically want the license owner contact id, you could do a dynamic query like this:
./api/v1/Archive/Dynamic?$select=company.ownerContactId&$filter=company.company_id eq 1