Get Operational contact for a customer via Netsuite REST API - netsuite

I'm currently building an integration with Netsuite using the Suitetalk REST API. I would like to retrieve the role of each contact associated with a customer to find the Primary and Operational contacts of the customer.
I have tried querying the customer endpoint:
record/v1/customer/ {customerId} /contact/ {contactId} /contactrole
This query returns Role id 14 which is 'Customer Center' for all customer contact records. This is obviously incorrect as this information is returned for contacts tagged with different roles when I check them via the UI.
I have also tried using Suiteql using the query endpoint with the similar results.
Is the query incorrect or should I be using a different endpoint? I have been stuck for days, so I would appreciate any suggestion.

A long comment. Hopefully it helps focus your search for a solution.
Contact Roles is the subrecord for contacts who have login access to a customer's account. The role listed there is the access role. Customer Center is the default access role in a vanilla Netsuite account.
The Records Catalog has contactList as the joining table for contact to company. I don't see any mention of role there that would correspond to contactrole in the records browser so it appears some documenation is missing.
You'll likely have to play with the SuiteQL queries feature to get this.
See Executing SuiteQL Queries Through REST Web Services in the NS help.

with suiteql you can get primary contact with this
{ "q": "select cus.companyname,cus.contact,cont.entityid from customer cus left outer join contact cont on cus.contact=cont.id where cus.id=<<id of ur customer>>"}

Related

Group name as claim in Azure AD

I have an enterprise app used to send claims to an on-prem ADFS.
I need to send the group names my Guest users belong to. I know that OOTB you can only send the Gpoup ID.
As suggested in other posts I can use the Graph API to get the group name, but how can I then send this as claim?
Unfortunately, it's only possible to get the object ids as of right now. This may be implemented in the future, however, in order to get the group names you will need to have some sort of service that makes calls to the Microsoft graph utilizing the ID.
Please raise the UserVoice or vote for similar uservoice

How to add a contact to contactgroup using Kentico Rest API?

There is a POS windows application where a store manager processes bills for customers. Our client want us to provide them an API service where this service will add a customer as a contact and also be assigned to a POS contacts contact group in Kentico 12.
Is there any possibility to achieve this using Kentico 12 Rest API out of the box feature?
In Kentico contact membership in a contact group is stored in om.contactgroupmembercontact object type. So I believe the following should work:
POST request to URL: ~/rest/om.contactgroupmembercontact?format=json
And the following data:
{
"ContactGroupMemberContactGroupID":yourContactGroupID,
"ContactGroupMemberType":0,
"ContactGroupMemberRelatedID":yourContactID,
"ContactGroupMemberFromManual":true // Manually added contact
}
You need to know ContactGroupID and ContactID which can be retrieved with other queries.

How to get groupwise Email Ids in google?

We are using Google for corporate since last 5 years. There have been many dozens google groups created by different site/business division/local administrators. Now we need to know, for each employee, which all groups he is a part of. Does google provide any API to fetch this details ?
Yes. The Directory API has a function to Retrieve all groups for a domain or the account. Here's a part in the docs that I think is what you are specifically aiming for:
All groups for the account — Use the customer argument with either my_customer or the account's customerId value. As an account administrator, use the string my_customer to represent your account's customerId. If you are a reseller accessing a resold customer's account, use the resold account's customerId. For the customerId value use the account's primary domain name in the Retrieve all users in a domain operation's request. The resulting response has the customerId value.

How to get logged in business account id in acumatica portal?

I am trying to filter the catalog item based on logged in customer business account. How do i get the logged in customer business account value in acumatica portal?
Regards,
R.Muralidharan
As you've found out, PXAccess.GetUserID() allows you to get this information, but you can also use the AccessInfo DAC in BQL queries:
Current<AccessInfo.userID>
Current<AccessInfo.userName>
I have used Base.currentCustomer.BAccountID and it works fine

How to get profile details from Netsuite using RESTlet?

I am accessing the Netsuite using RESTlet by Oauth token. I could get a contact, customer, and other details. Now I want to get profile [acccount holder] details like my first name, last name, mail id, role, and so on.
What is the record type should i use to get above mentioned details?
Or what alternate code should use to get the details?
It depends on type of user, mostly you would need to query
employee
, it has all the details. when querying/searching you may want to add filter that ['giveacess', 'is', 'T'] as you only want to query users with login access.
Other types of users can be customers, partners and vendors
These users can have access to their portals, eg: customer has access to customer portal, vendor to vendor portal and partner to partner portal.
For details on fields available to query , I suggest you to check record browser link

Resources