Solved

Restful API get owner details using ownerID

  • 12 May 2023
  • 8 replies
  • 175 views

Hi all, I am busy retrieving information regarding activities using the RestApi, but have some difficulty linking the ownerID to a specific user to get his contact details. Using the RestApi, is there any way of getting the contact details for an owner by using the ownerID? I can’t seem to find an entity to search owners by, or I might be overlooking something. Thank you

 

 

 

icon

Best answer by pieterandries 22 May 2023, 16:13

View original

8 replies

Userlevel 7
Badge +4

@pieterandries could you provide some additional information to help you better, like postman/UI screenshots, payload and where/what do you expect?

Hi @RohitRattan88, thank you for reaching out. I am currently using the email Address as an unique identifier for the 3rd party application.

This is the mapping for the Tasks entity in Acumatica. I do have the Owner email which I am using to get the correct contact in the 3rd party application, but when trying to integrate from the 3rd party application to Acumatica, I need the Owner ID to link the Owner to an Task/Activity.


I am wondering if there is a way to get the Owner ID using an email address directly?
 

The way I am currently trying to do this is by filtering the “employee” entity on the ContactInfo/Email field using the email address obtained from the 3rd party to retrieve the “OwnerEmployeeName”, and then filtering the “contact” entity on the “OwnerEmployeeName” to get a list of contacts which contains the Owner ID to whom that “OwnerEmployeeName” is connected to. I am pretty sure there should be an easier way to achieve this because currently I am using the “OwnerEmployeeName” , which isn’t an unique identifier to get the Owner ID

Userlevel 7
Badge +4

@pieterandries  I would try something like this:

 

Thank you @RohitRattan88 

From what I can see the OwnerID doesn’t match up with the ContactID, for example this one contact I am testing has an OwnerID of 32, but an ContactID of 64456. The email used in the Activity where I retrieved the OwnerID from is exactly the same as the one in the Contact object, so I did confirm it to be the same contact, but with different ID’s. In Hubspot there is a seperate API call to get owners specifically, but it doesn’t seem to be the case for Acumatica

Userlevel 7
Badge +4

@pieterandries I looked up DAC schema and found that ContactID on contact joins on OwnerID on CRPMTimeActivity. However, i could not use that to get “Employee” contact using API. It would return emply response. I was able to get other type of contacts with api though. see below:

 

not sure whats broken but ContactID seems to be the field you want

Thank you @RohitRattan88, When creating a Activity I am forced to use the OwnerID instead of the ContactID to assign the correct user to the activity, and weirdly enough OwnerID is a string in the responses and queries while the ContactID is an integer. I would think the Owner is a seperate object from Contacts and Employees, but I can’t seem to find it in the DAC so it might not be the case.

This is taken from the Contact object.

Thank you for the assistance RohitRattan.

The way I have managed to get the correct Owner ID was by creating a Generic Inquiry that returns the correct ContactID using the email. Doing it this way returns the default contact ID. I’m not sure why the other ContactID’s didn’t match
 

 

Userlevel 7
Badge

Thank you for sharing your solution with the community @pieterandries !

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved