Microsoft Graph API - Can't fetch group members of contact type - json

I have a group that contains group, user and contact as members. I can fetch all of them in Admin UI and via PowerShell command Get-DistributionGroup -Identity 'myGroup'. Result looks like
[{
"Alias": "xxxxxx",
"Guid": "xxxxxx",
"Identity": "xxxxx",
"PrimarySmtpAddress": "xxxxxx",
"RecipientType": "UserMailbox",
"SamAccountName": "xxxxxxx",
"WindowsLiveID": "xxxxxxx"
},
{
"Alias": "yyyyyyyyy",
"Guid": "yyyyyyyyy",
"Identity": "yyyyyyyyy",
"PrimarySmtpAddress": "yyyyyyyyy",
"RecipientType": "MailUniversalSecurityGroup",
"SamAccountName": "yyyyyyyyy",
"WindowsLiveID": ""
},
{
"Alias": "zzzzzzzzzz",
"Guid": "zzzzzzzzzz",
"Identity": "zzzzzzzzzz",
"PrimarySmtpAddress": "zzzzzzzzzz",
"RecipientType": "MailContact",
"SamAccountName": "",
"WindowsLiveID": ""
}
]
Documentation states that GET /groups/{id}/members should return all group members, including users, contacts, and other groups as members.
I get only user and group tyro members back, not mail contact is returned.
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects",
"value": [{
"#odata.type": "#microsoft.graph.user",
"id": "xxxxxx",
........
},
{
"#odata.type": "#microsoft.graph.group",
"id": "yyyyyyyyy",
........
}
]
}
Is this a bug in API or documentation?

Currently, the /v1.0 endpoint does not support Contacts. Since it isn't aware of Contacts, it isn't capable of returning them via /members.
The /beta endpoint has support for the microsoft.graph.orgContact entity. If you switch to this version, you should start seeing Contact members showing up in the results.
This is documented in the Known Issues but it's a little hidden. It isn't filed under Groups but instead under Contacts: Organization contacts available in only beta.

Related

Integrating Docusign Identity Verification (Phone Authentication) with an envelope

I was using identity verification feature from Docusign with envelopes. Previously, envelopes are working fine without it. Then I enabled this feature and searched on the Docusign API Documentation, how to implement this feature. I got the necessary details like authentication token, workflow id. Try to hit the endpoint using Post request. Everything's fine but having issues in the body part of the post request getting invalid phone number response. Thank you for your time! Please help!
//Post request endpoint
https://demo.docusign.net/restapi/v2.1/accounts/f8594d59-9d52-xxxx-xxxx-xxxxxxxxxxxx/envelopes
//header
Authorization: Bearer {accestoken}
Content-Type: application/json
Acces: application/json
//request body
{
"accountId": "f8594d59-9d52-xxxx-xxxx-xxxxxxxxxxxx",
"templateId": "4e2ba389-5d26-xxxx-xxxx-xxxxxxxxxxxx",
"emailSubject": "Please sign the contract",
"templateRoles": [
{
"roleName": "Sender",
"name": "Name",
"email": "fName.lName#xyz.com",
"identityVerification": {
"workflowId": "c368e411-1592-xxxx-xxxx-xxxxxxxxxxxx",
"steps": null,
"inputOptions": [
{
"name": "phone_number_list",
"valueType": "PhoneNumberList",
"phoneNumberList": [
{
"countryCode": "1",
"number": "8956324511"
}
]
}
]
}
},
{
"roleName": "Customer",
"name": "cFName",
"email": "cFName.cLName#gmail.com"
}
],
"status": "sent"
}
//Response
{
"errorCode": "PHONE_NUMBER_INVALID",
"message": "Phone number is not valid."
}
//Expected Response can vary
{
"envelopeId": "e8342cd0-ea2b-xxxx-xxxx-xxxxxxxxxx",
"uri": "/envelopes/e8342cd0-ea2b-xxxx-xxxx-xxxxxxxxxx",
"statusDateTime": "2023-01-13T05:22:35.0100000Z",
"status": "sent"
}
According to https://www.areacodehelp.com/where/area_code_895.shtml area code 895 is not valid.
Try with a valid phone number to confirm the issue, but to me it looks like the number you used here is indeed not a valid phone number.
PS
If you meant to use a number in Azerbaijan, you need to change the country code from "1" to "895" as it's a country code for a different country (the way you have is if for the USA)
So, basically what I found is ID verification won't work with template roles because of the syntax compatibility. But it will work with composite templates, I made it work with composite template.
Additionally, both of the methods are compatible idVerification or phoneAuthentication. I am using idVerification for the first Signer and phone Authentication for the second signer
Docusign docs have more methods as well like sms auth, etc. Explore it from these links:
https://developers.docusign.com/docs/esign-rest-api/how-to/phone-auth/
https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/
Check examples, in my usecase I explored Generic JSON Request/Response
Thanks for all the support from Inbar and the community!
{
"accountId": "f8594d59-9d52-xxxx-xxxx-xxxxxxxxxx",
"emailSubject": "Please sign the contract",
"status": "sent",
"compositeTemplates": [
{
"compositeTemplateId": "1",
"serverTemplates": [
{
"sequence": "1",
"templateId": "4e2ba389-5d26-xxxx-xxxx-xxxxxxxxxx"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"roleName": "Sender",
"recipientId": "1",
"name": "Name",
"email": "fName.lName#xyz.com",
"identityVerification": {
"workflowId": "c368e411-1592-xxxx-xxxx-xxxxxxxxxx",
"steps": null,
"inputOptions": [
{
"name": "phone_number_list",
"valueType": "PhoneNumberList",
"phoneNumberList": [
{
"countryCode": "1",
"number": "1234567890"
}
]
}
]
}
},
{
"roleName": "Customer",
"recipientId": "2",
"name": "cName",
"email": "cfName.clName#gmail.com",
"phoneAuthentication": {
"senderProvidedNumbers": [
"+11234567890"
],
"recipMayProvideNumber": false
},
"idCheckConfigurationName": "Phone Auth $"
}
]
}
}
]
}
]
}
Note: Use valid phone number!

re-invite outcast user from room

Is there a way via the API to re-invite a user to a room who has previously been outcast?
Created a room
POST /create_room_with_opts
{
"name": "testroompersistent",
"service": "foo",
"host": "bar" ,
"options": {
"title": "Super important meeting",
"description": "This meeting is super important",
"persistent": "true",
"allow_user_invites": "true"
}
}
Invited a user
POST /send_direct_invitation
{
"name": "testroompersistent",
"service": "foo",
"password": "",
"reason": "Check this out!",
"users": "user#companyDomain.co.uk"
}
User joins room
Admin sets user affiliation to "outcast"
POST /set_room_affiliation
{
"name": "testroompersistent",
"service": "foo",
"jid": "userJid",
"affiliation": "outcast"
}
Invited a user again
POST /send_direct_invitation
{
"name": "testroompersistent",
"service": "foo",
"password": "",
"reason": "Check this out!",
"users": "user#companyDomain.co.uk"
}
Set affiliation to "member"
POST /set_room_affiliation
{
"name": "testroompersistent",
"service": "foo",
"jid": "userJid",
"affiliation": "member"
}
I've tried to set the affiliation before and after the invite but to no avail.
I was using the jid I got back from /get_room_occupants to set the affiliation this jid had "/[numbers]" after it and I assume it wasn't setting the affiliation correctly. I was getting 0=success back but it must not have been working correctly.
I have changed the jid to exclude the random numbers I got back from /get_room_occupants. Thanks #badlop for taking the time to respond.

How can I see logs of the JSON post bodies sent by zapier to my CRM (Current RMS) via the Webhook zap during setup and testing?

I'm trying to send new users / new customres of my WooCommerce store into the rental management app current-rms.com as new Organisations / new contacts. Since Current RMS does not have a native Zap, I am trying to use the generic Webhook zap that Zapier maintains.
Specifically, I'd like to see the sent JSON body in Zapier posts that I make during the setup and testing of the Zap after clicking "Make a Zap!". The Task History is not detailed enough nor does it show hits during test and setup, since it's not live yet.
My trigger is a WooCommerce New Customer. This is working with Zapier WooCommerce Plugin and webhooks OK.
My action is the generic Zapier "Webhooks" Zap. The label "instant" appears next to it in the list at /app/zaps and it is "off".
One version uses JSON PAYLOAD as the action.
Another version uses CUSTOM PAYLOAD as the action.
Wrap request in array is YES.
Unflatten is YES.
My API key and subdomain are in the app URL as query strings and working OK.
When I hit test I get:
We had trouble sending your test through.
The app returned "Invalid JSON - missing or invalid entry for 'member'". This usually happens when your Zap is missing a required field or a field value isn't in a recognized format.
We made a request to api.current-rms.com and received (400) Bad Request.
Official docs are at: https://api.current-rms.com/doc#members-members-post
Logging available at Current RMS side
Part of the authentication of Current RMS involves knowing the domain of the account you are trying to access, in my case its therockfactory due to it being an account for my company https://therockfactory.net/
https://api.current-rms.com/api/v1/members?apikey=APIKEYCENSORED&subdomain=therockfactory
which returns the following when I use the correct API key:
{"webhook_logs":[],"meta":{"total_row_count":0,"row_count":0,"page":1,"per_page":20}}
Maybe if I could see the actual hit that Zapier is posting to Current I could wrap my confused brain around it better? What me worry.
The hit should look somewhat similar to this example, but I've not been able to locate it so far... (in Zapier)
Headers
Content-Type: application/json
Body
{
"member": {
"name": "Chris Bralton",
"description": "Pictures and leaned back was strewn at one would rather more. People don't want of his own means of one hand! Unless it from our pioneer has he fallen tree but that ever stronger and a. Hid among us against the full of verdure through by my eyes.",
"active": true,
"bookable": false,
"location_type": 0,
"locale": "en-GB",
"membership_type": "Contact",
"lawful_basis_type_id": 10001,
"sale_tax_class_id": 1,
"purchase_tax_class_id": 1,
"tag_list": [
"[\"Red\", \"Blue\", \"Green\"]"
],
"custom_fields": {},
"membership": {},
"primary_address": {
"name": "Chris Branson",
"street": "16 The Triangle",
"postcode": "NG2 1AE",
"city": "Nottingham",
"county": "Nottinghamshire",
"country_id": "1",
"country_name": "United Kingdom",
"type_id": 3001,
"address_type_name": "Primary",
"created_at": "2015-06-29T10:00:00.000Z",
"updated_at": "2015-06-29T10:30:00.000Z"
},
"emails": [
{
"address": "abigail.parker#ggmail.co.uk",
"type_id": 4001,
"email_type_name": "Work",
"id": 1
}
],
"phones": [
{
"number": "+44 115 9793399",
"type_id": 6001,
"phone_type_name": "Work",
"id": 1
}
],
"links": [
{
"address": "www.facebook.com/profile.php?id=566828251",
"type_id": 5002,
"link_type_name": "Facebook",
"id": 1
}
],
"addresses": [
{
"name": "Chris Branson",
"street": "16 The Triangle",
"postcode": "NG2 1AE",
"city": "Nottingham",
"county": "Nottinghamshire",
"country_id": "1",
"country_name": "United Kingdom",
"type_id": 3002,
"address_type_name": "Billing",
"created_at": "2017-06-29T10:00:00.000Z",
"updated_at": "2017-06-29T10:30:00.000Z",
"id": 1
}
],
"service_stock_levels": [
{
"item_id": 10,
"store_id": 1,
"member_id": 1,
"asset_number": "Chris Bralton",
"serial_number": "",
"location": "",
"stock_type": 3,
"stock_category": 60,
"quantity_held": "1.0",
"quantity_allocated": "0.0",
"quantity_unavailable": "0.0",
"quantity_on_order": "0.0",
"starts_at": "",
"ends_at": "",
"icon": {
"iconable_id": 85,
"id": 1,
"image_file_name": "abigail.jpeg",
"url": "https://s3.amazonaws.com/current-rms-development/64a0ccd0-5fbd-012f-2201-60f847290680/icons/46/original/abigail.jpeg",
"thumb_url": "https://s3.amazonaws.com/current-rms-development/64a0ccd0-5fbd-012f-2201-60f847290680/icons/46/thumb/abigail.jpeg",
"created_at": "2015-06-29T10:00:00.000Z",
"updated_at": "2015-06-29T10:30:00.000Z",
"iconable_type": "StockLevel"
},
"custom_fields": {},
"id": 487,
"item_name": "Sound Engineer",
"store_name": "Nottingham",
"stock_type_name": "Service",
"stock_category_name": "Resource"
}
],
"day_cost": "",
"hour_cost": "",
"distance_cost": "",
"flat_rate_cost": "",
"icon": {
"image": ""
},
"child_members": [
{
"relatable_id": 317,
"relatable_type": "Member",
"related_id": 25,
"related_type": "Member"
}
],
"parent_members": [
{
"relatable_id": 317,
"relatable_type": "Member",
"related_id": 25,
"related_type": "Member"
}
]
}
}
UPDATE: After reading my chosen answer I was able to see what Zapier was sending:
[
{
"member[emails_attributes][0][address]": "test#test.co.nz",
"member[membership_type]": "Organisation",
"member[name]": "Testafari Testing"
}
]
You can send your webhook to a tool like this one to inspect the payloads that are being sent from anywhere on the internet: https://requestbin.com/
You can find more help in regards to using Webhooks by Zapier and other ideas on how you can troubleshoot issues stemming from its use: https://zapier.com/apps/webhook/help#inspect-the-requests

Root Site Facet not returned on sites/search call

When making a call to the Microsoft Graph /sites?search endpoint, a root site facet is not returned.
Here is an example of the search:
https://graph.microsoft.com/v1.0/sites?search=fake Archive
It returns:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"value": [{
"createdDateTime": "2017-11-04T18:52:44Z",
"id": "fakeau.sharepoint.com,0f736b6a-d7fa-498d-b13f-72af82d58b49,7c055ac7-0d31-4341-8158-8055950f37c8",
"lastModifiedDateTime": "2017-11-14T23:21:51Z",
"name": "fake Archive",
"webUrl": "https://fakeau.sharepoint.com/sites/fake Archive",
"displayName": "fake fake Archive"
}]
}
There is no root site facet. If I use the /site endpoint to access the site directly:
https://graph.microsoft.com/v1.0/sites/fakeau.sharepoint.com,0f736b6a-d7fa-498d-b13f-72af82d58b49,7c055ac7-0d31-4341-8158-8055950f37c8
I get the response:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites/$entity",
"createdDateTime": "2017-11-14T23:19:51.437Z",
"description": "",
"id": "fakeau.sharepoint.com,0f736b6a-d7fa-498d-b13f-72af82d58b49,7c055ac7-0d31-4341-8158-8055950f37c8",
"lastModifiedDateTime": "2018-03-23T12:23:40Z",
"name": "fake Archive",
"webUrl": "https://fakeau.sharepoint.com/sites/fake Archive",
"root": {},
"siteCollection": {
"hostname": "fakeau.sharepoint.com"
},
"displayName": "fake fake Archive"
}
Notice this now has a root site facet.
Is this a bug, or are there some situations in which the root site facet should not be shown in the /sites?search results?
The sites/search endpoint only returns a small subset of a site's properties:
id, name, description, createdDateTime,lastModifiedDateTime, and webUrl.
In order to retrieve the full metadata, you'll need to make subsequent requests to the /sites/{id} endpoint.

Fiware IDM-Keyrock: How to check if user has some permission(permission_fiware) using keyrock API

I created some permissions(permission_fiware table) in Horizon regarding urls that can or cant be seen.I created permission(name:Upload images, with resource: "/image_upload") and role(role_fiware) admin that has this permission.
Now i want to check whether some user that is logged in to my application can view that page on url "/image_upload" that i defined in horizons permission.So my guess is i should first check what roles user has, and after that whether those roles that user is assigned have required permission.
So, my question is next:
How can i list what permission one specific user has.
In Keyrocks API:
http://docs.keyrock.apiary.io/#reference/keystone-extensions/role-user-relationships/list-users-role-assignments
i found how i can list all permissions for a specific role
http://keyrock/OS-ROLES/roles/role_id/permissions
but how can i get information about what roles(role_fiware) are assigned to a user?
As stands in the FIWARE-IDM documentation doing a request against the resource user of your IDM host using the access_token, will return the user information, and within that information you will find the roles that user have assigned:
GET
/user?access_token=XXXXXXXXXXXXXXXXXXXX
Response:
{
"organizations": [{
"website": "",
"city": "",
"name": "Franchise1",
"img": "/static/dashboard/img/logos/small/group.png",
"domain_id": "default",
"enabled": true,
"id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"roles": [{
"name": "Franchise manager",
"id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}],
"email": "",
"description": "Test Organization"
}],
"displayName": "user1",
"roles": [{
"name": "End user",
"id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}],
"app_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"email": "user1#test.com",
"id": "user1"
}