Jump to content

Entity name for 'Co-worker' ?


Recommended Posts

Using data::entityBrowseRecords2 I am not getting any matches when using "Contact" as the entity type.

What is the entity name for 'Co-worker' please?

Should I be targeting com.hornbill.servicemanager rather than com.hornbill.core ?
If so, can our local admin give the account/token I am using permission as my request fails when not target 'core'?

Using the Service Manager front end, I only find users when searching against "Co-worker" and not "Contact".

image.png.ee3b28c25dd285b94e0b3978afa8f145.png

Link to comment
Share on other sites

Hi Richard,

Thanks for your post. 

 

Contact are used for people who are external to your company.   These are typically used when providing support to external organizations.  Contacts are used in the Customer Manager app and are also used to provide access to the Customer Portal.

image.png

 

Co-workers is a name used in some places within UI that represents users.  Users who are internal to your company have a Hornbill user account under which they can log in as either a basic or full user. 

image.png

 

I hope that's the info that you are looking for.

 

 

  • Like 1
Link to comment
Share on other sites

Thanks James. That makes sense.

UserAccount works for the entity type. 👍

Unfortunately, I then get a new exception when trying to use data::entityBrowseRecords2

Quote

Hornbill.RequestFailureException: 'The search column 'h_email_1' is not allowed'

 

This is my C# code to generate the API request.

xmlmc.AddParam("application", "com.hornbill.core");
xmlmc.AddParam("entity", "User");
var searchFilterParams = new List<XmlmcParam>() {
    new XmlmcParam() { Name = "column", Value = "h_email_1" },
    new XmlmcParam() { Name = "value", Value= "myemail@here.co" },
    new XmlmcParam() { Name = "matchType", Value="exact" }
};
xmlmc.AddParam("searchFilter", searchFilterParams);
xmlmc.AddParam("maxResults", 5);
xmlmc.Invoke("data", "entityBrowseRecords2");

 

Link to comment
Share on other sites

1 hour ago, RichardD said:

The search column 'h_email_1' is not allowed

This would indicate that you are not allowed to search by using the h_email_1 column.
The documentation states that:

Specify one or more values as search criteria. You can only specify columns that are defined by the entity as searchable. Invoke data::entityGetBrowseMetaData operation to get the list of searchable columns and it's metadata.

so I would recommend invoking that API to see what columns are defined as searchable.

  • Like 1
Link to comment
Share on other sites

Hi @Steve Giller
Moving on to my next task, requesting open calls for the UserAccount.
When trying to query data::entityBrowseRecords2 for "Requests" entity type it responds with

Quote

Hornbill.RequestFailureException: 'You need the right 'app.h.searchEntityRecords' to perform this entity operation'

Is there an alternative way of requesting calls that my token might already have permission to execute, please?
 

xmlmc.AddParam("application", "com.hornbill.servicemanager");
xmlmc.AddParam("entity", "Requests");
var searchFilterParams = new List<XmlmcParam>() {
    new XmlmcParam() { Name = "column", Value = "h_user_id" },
    new XmlmcParam() { Name = "value", Value= "My-UserAccount-ID" },
    new XmlmcParam() { Name = "matchType", Value="any" }
};
xmlmc.AddParam("searchFilter", searchFilterParams);
xmlmc.AddParam("maxResults", 10);
xmlmc.Invoke("data", "entityBrowseRecords2");

 

Link to comment
Share on other sites

Hi @James Ainsworth
Thank you. I'm successfully getting a UserAccount entity. 👍

Is Requests the correct entity type to use for (open) calls please?

I have used https://api.hornbill.com/data/?op=entityGetBrowseMetaData to see what properties of UserAccount were available for the permissions allocated to the API token I am using. Is there a method I may use to see what entity names are available for an application?
e.g. To get a list of UserAccount, Requests, etc. for com.hornbill.core and com.hornbill.servicemanager?

Would one of my colleagues with administrator access for our Service Manager instance likely have access to the EntityExplorer tool you shared screenshots of?

Link to comment
Share on other sites

Hi Richard,

Requests is the main entity for open calls.

You can try this method for getting a list of entities for an application. https://docs.hornbill.com/esp-api/services/data/entitySearch/index.  You may find that the API documentation in the new docs.hornbill.com easier to search for available APIs. 

This wiki page shows the required roles/rights that are needed to access the Entity Explorer. https://wiki.hornbill.com/index.php?title=Entity_Explorer

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...