How to get the user information using the user lookup ID from fields property when accessing items from a share-point list using Ms Graph API - sharepoint

I am accessing a Share-point list using the MS graph API endpoint:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?expand=fields
I am getting the list items just fine, but I also want to get the user information attached in each field. The data item returned looks like this:
{
...other properties,
"fields": {
"#odata.etag": "\"eTag,1\"",
"id": "1",
"ContentType": "Item",
"Title": "<Some Title>",
"Modified": "<modified dateTime>",
"Created": "<created dateTime>",
"AuthorLookupId": "12",
"EditorLookupId": "12",
"_UIVersionString": "1.0",
"Attachments": false,
"Edit": "",
"LinkTitleNoMenu": "<num>",
"LinkTitle": "<num>",
"ItemChildCount": "0",
"FolderChildCount": "0",
"_ComplianceFlags": "",
"_ComplianceTag": "",
"_ComplianceTagWrittenTime": "",
"_ComplianceTagUserId": "",
"Status_Name": "<status_name>",
"Title0": "<some_title>",
"Dept": "Dept A",
"Emp_LeadLookupId": "200", //This is the user whose details I need(email-id)
"Quality_Approver": "<some_user>"
}
}
How do I get the user's details as well and not just a LookupId, OR how can I use the look up ID to get the said user's information?
I searched above and beyond but didn't find anything relevant. Any help is greatly appreciated!

Currently Microsoft Graph is not support the function of finding users through the lookup column.

Related

How to read nested API links within the JSON file

If my JSON file is coming out like this, what needs to happen is go to the API link within the u_parent and populate the values from that API link with sysparm_display_value=true into the df. Possible? I need to do this because this API link is giving me the same name and parent and only the link in u_parent will give me the correct parent details.
{
"u_name": "******",
"u_parent": {
"display_value": "*****",
"link": "https://*****.******.com/api/now/table/u_region_hierarchies/ed7f652f1b29341051380e93cc4bcbd7"
},
"sys_id": "159967df1b75601070bfdb9cbc4bcb35",
"sys_updated_by": "mlarcheveque",
"sys_created_on": "01/24/2021 17:31:26",
"sys_mod_count": "1",
"u_active": "true",
"u_region_id": "**********",
"sys_updated_on": "07/30/2021 14:13:33",
"sys_tags": "",
"sys_created_by": "admin"
},
The API link from that u_parent displays the following values and i want the display value from u_parent
{
"result": {
"u_name": "*****",
"u_parent": {
"display_value": "*****",
"link": "https://*****.*****.com/api/now/table/u_region_hierarchies/6d7f252f1b29341051380e93cc4bcbd7"
},
"sys_id": "217f652f1b29341051380e93cc4bcbd4",
"sys_updated_by": "mlarcheveque",
"u_id": "*****",
"sys_created_on": "07/30/2021 14:11:49",
"sys_mod_count": "0",
"sys_updated_on": "07/30/2021 14:11:49",
"sys_tags": "",
"sys_created_by": "mlarcheveque"
}
}
So i am thinking this would involve a do while loop that goes through each row and gets the value from the nested API link

Issue on Docusign Admin Api getUserProfile

Hi I am facing an issue while loading the endpoint point /v2/organizations/{organizationId}/users/profile
I am getting a 404 error
Attached below screenshots for the postman response and getting organisationId
The correct baseUrl for demo Admin API is https://api-d.docusign.net/management/v2/
Try to change that and see if that works.
In order for that endpoint to work you're going to need to provide some additional parameters in the URL. For retrieving a user's profile directly, you should be able to use:
https://api-d.docusign.net/management/v2/organizations/{OrgID}/users/profile?email=useremail#example.com
The result looks like this:
{
"users": [
{
"id": "28fbe7e4-xxxx-xxxx-xxxx-c26569aa827c",
"site_id": 1,
"site_name": "Demo",
"user_name": "Matt_SATest_1",
"first_name": "MattSAT_1",
"last_name": "K",
"user_status": "active",
"default_account_id": "70da9c0c-xxxx-xxxx-xxxx-7b3d6733328e",
"default_account_name": "Matt K",
"is_organization_admin": false,
"created_on": "2020-08-25T20:38:57.533",
"memberships": "",
"identities": "",
"is_device_verification_enabled": true
}
]
}
To retrieve a list of users for an org, you should be able to use:
https://api-d.docusign.net/management/v2/organizations/{OrgID}/users?URLParameters.
The URL parameters for this particular call require one of the following: account_id, organization_reserved_domain_id, or email. You're required to use at least one, but you should also be able to use more than one parameter at a time.
The result looks something like this:
{
"users": [
{
"id": "28fbe7e4-xxxx-xxxx-xxxx-c26569aa827c",
"user_name": "Matt_SATest_1",
"first_name": "Matt",
"last_name": "K",
"user_status": "active",
"email": "email#example.com",
"created_on": "2020-08-25T20:38:57.533"
}
],
"paging": {
"result_set_size": 1,
"result_set_start_position": 0,
"result_set_end_position": 0,
"total_set_size": 1
}
}

Way to select checkbox Tab in create envelope api and read in formdata api is not consistent

I am working with predefined template. Template has checkboxes to capture user's communication preference with following data labels -
COMMUNICATION_PREF-FAX
COMMUNICATION_PREF-EMAIL
COMMUNICATION_PREF-PHONE
In create envelop API call if I want to select a particular checbox for example EMAIL then I have to pass following in request body
POST /envelopes
"checkboxTabs": [
{
"tabLabel": "COMMUNICATION_PREF-EMAIL",
"selected": "true"
}
]
And after signing is complete when I read form fields using formdata api /envelopes/{{envelopeId}}/form_data I get following
{
"name": "COMMUNICATION_PREF-EMAIL",
"value": "X",
"originalValue": "X"
}
As you can see that checkbox state (checked or unchecked) is represented differently in both case. Value is set selected=true is not consistent with how its read back value = "X" I tried passing value = "X" in create envelope api but it doesn't work.
This inconsistency is problem for the calling application. Should it store checkbox state as true/false or X / empty.
Its not possible to apply translation logic (like treat X as selected) because while reading formdata, field type information (whether it's checkbox or not) is not available.
Any advice is much appreciated.
Instead of form_data try this endpoint and include recipients,tabs as a qp:
GET /accounts/[account_id]/envelopes/[envelope_id]include=recipients,tabs.
The response object will contain exactly what you're looking for. Here is a sample:
{
"status": "completed",
...
"recipients": {
"signers": [
{
"tabs": {
"checkboxTabs": [
{
"name": "",
"tabLabel": "Checkbox 105f25...0b2",
"selected": "true",
"shared": "false",
"requireInitialOnSharedChange": "false",
...
}
If you are hellbent on using the formData API, keep reading:
That formData API should return field type information within the name property. Basic string manipulation will enable you to discern the type. Here's a sample response object from an envelope I created...
{
"formData": [...]
"envelopeId": "7719639c-xxxx-xxxx-xxxx-c847ebebb9c6",
"status": "completed",
"sentDateTime": "2020-05-29T00:13:00.0000000Z",
"recipientFormData": [
{
"formData": [
{
"name": "Checkbox 105f257e-xxxx-xxxx-xxxx-03bae25e70b2 | tabGroups: [\"Checkbox Group 9620de9a-xxxx-xxxx-xxxx-dbf6c90e98af\"]",
"value": "X"
},
...
],
"recipientId": "85c97d0b-xxxx-xxxx-xxxx-fcc000c6400e",
"name": "Name",
"email": "test#test.com",
"SignedTime": "...",
"DeliveredTime": "..."
}
]
}

What does it mean "Property has an invalid value"?

During the creation of a batch of users in Azure AD by using the Graph API version 1.0 I receive the followiing error message:
Property has an invalid value
As you can see, there is not property name in the message, so I can't understand the real problem. What I can say is that those users have no particular conditions among the all others successfully created.
Any ideas?
Update 1:
As people asked, below are the post data. Since there is sensitive data, I have to changed names and som other personal data:
POST https://graph.microsoft.com/v1.0/users
And the JSON payload:
{
"accountEnabled": false,
"country": "BR",
"displayName": "Jane Sagan",
"givenName": "Jane",
"mailNickname": "jane.sagan",
"otherMails": [
"jane.sagan.#gmail.com"
],
"passwordProfile": {
"forceChangePasswordNextSignIn": false,
"password": "J#n3Sa8aN"
},
"surname": "Sagan",
"usageLocation": "BR",
"userPrincipalName": "jane.sagan#university.br",
"userType": "Member"
}
The property "otherMails" doesn't support the format "jane.sagan.#gmail.com".
Username cannot end with '.' in O365. You can have a try (create a user whose username ends with '.') in O365 portal to verify it.

Instagram API returns only 4 likes data

I'm using the Instagram API to fetch images with a certain hashtag that have been liked by my organization. But when the API makes the get call, the response comes back with data like this, where the like count is 83 (!) and the actual like data returned only shows 4 (!). I've seen postings here that indicate that Instagram returns about 120 data for likes. How come I'm only getting four?
The api call I'm using is:
https://api.instagram.com/v1/tags/mytag/media/recent/?client_id=myclientID
"likes": {
"count": 83,
"data": [
{
"username": "something",
"profile_picture": "picture",
"id": "idhere",
"full_name": "namehere"
},
{
"username": "",
"profile_picture": "",
"id": "",
"full_name": ""
},
{
"username": "",
"profile_picture": "",
"id": "",
"full_name": ""
},
{
"username": "",
"profile_picture": "",
"id": "",
"full_name": ""
}
]
},
When you fetch medias from Instagram using these endpoints:
/users/<user-id>/media/recent
/tags/<tag-name>/media/recent
You wouldn't have all likes in the response; same for comments. It's just limit set by Instagram. I think it might be really expensive to return all (or a lot) likes/comments in each media users fetch.
But don't worry, If you get medias you want, you will have their id and you could use this endpoint:
/media/<media-id>/likes
And then you will have all likes (use pagination to fetch them all) and do a great stuff with them.
Hope it helps you.
This could be three things:
1) A bug, but that's unlikely (ha a pun!)
2) Pagination. You need to ask for more data in another call with MIN_TAG_ID and/or MAX_TAG_ID set.
3) Privacy. Instagram users have privacy settings on their profiles. Described here. This would definitely lower the count even with pagination.

Resources