Inconsistency in MS Teams graph api - GET channels - microsoft-graph-api

In the response of GET - https://graph.microsoft.com/v1.0/teams/{team_id}/channels?$filter=membershipType eq 'private'.
I am getting channels which are not visible in the Teams app interface.
e.g.
{"id": "",
"createdDateTime": "",
"displayName": "testingteam",
"description": null,
"isFavoriteByDefault": null,
"email": null,
"webUrl": null,
"membershipType": "private"
},
Is there any key using which i can differentiate these forbidden channels from the valid ones?

We are not able to repro this issue. The graph api returned correct response. Can you check if all webURL part for all such teams you are getting is null. If yes you can add filter ($filter=webUrl ne null).

Related

Microsoft Graph User filter with multiple issuerIds

I am trying to filter the Graph (API v1.0) User objects by passing multiple email addresses to filter by. I am able to filter by a single value but can't quite figure out how to write the filter query for multiple values.
I currently have this query which appears to work for $filter
identities/any(x:x/issuer eq 'test.onmicrosoft.com' and x/issuerAssignedId eq 'user_1#test.com')
which returns something like the following
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users",
"value": [
{
"businessPhones": [],
"displayName": "unknown",
"givenName": "test",
"jobTitle": null,
"mail": null,
"mobilePhone": null,
"officeLocation": null,
"preferredLanguage": null,
"surname": "test",
"userPrincipalName": "bffc1593-ce73-472c-b630-799abb87f79d#test.onmicrosoft.com",
"id": "bffc1593-ce73-472c-b630-799abb87f79d"
}
]
}
How would I write this filter to filter using multiple equality checks by an array of email address?
I've tried the following $filter
identities/any(x:x/issuer eq 'test.onmicrosoft.com' and ((x/issuerAssignedId eq 'user_1#test.com') or (x/issuerAssignedId eq 'user_2#test.com')))
identities/any(x:x/issuer eq 'test.onmicrosoft.com' and (x/issuerAssignedId eq 'user_1#test.com' or x/issuerAssignedId eq 'user_2#test.com'))
but it returns an error response of Request_UnsupportedQuery with the message Unsupported Query.
Can anyone kindly state what the query language is here too? I thought it was kusto but I can't seem to figure out the syntax.
When filtering users by identities, issuerAssignedId and issuer properties cannot appear more than once in the filter query.
Also only eq operator is supported, so you cannot use in operator like this
identities/any(x:x/issuer eq 'test.onmicrosoft.com' and x/issuerAssignedId in ('user_1#test.com','user_2#test.com'))
Resources:
User properties

How to use twilio rest api with loadrunner?

I am currently doing POC(proof of concept) on IVR loadtesting where I just want to call a IVR and have no interest in sound quality and all. So I come across twilio rest api which can make a outbound call.
It is working perfectly with python but I want to use it with loadrunner as it support rest api. I searched for twilio api urls and key value combinations. but hard luck for this. can anyone provide me the required URL and key value arrangement. or can guide me how to get those.
thanks in advance.
The documentation, Making Calls, has some code examples and example responses. You can make an API call using Postman (POST via x-www-form-urlencoded) and see the key:value pairs in the returned JSON, as shown below. API Explorer in Twilio Console is also useful for that.
{
"date_updated": null,
"price_unit": "USD",
"parent_call_sid": null,
"caller_name": null,
"duration": null,
"from": "+15095550100",
"to": "+14075550100",
"annotation": null,
"answered_by": null,
"sid": "CAaacc78574ae1b9d2bf483f0123456789",
"queue_time": "0",
"price": null,
"api_version": "2010-04-01",
"status": "queued",
"direction": "outbound-api",
"start_time": null,
"date_created": null,
"from_formatted": "(509) 555-0100",
"group_sid": null,
"trunk_sid": null,
"forwarded_from": null,
"uri": "/2010-04-01/Accounts/ACdeca5d479509eeb8beaba0123456789/Calls/CAaacc78574ae1b9d2bf483f0123456789.json",
"account_sid": "ACdeca5d479509eeb8beaba0123456789",
"end_time": null,
"to_formatted": "(407) 555-0100",
"phone_number_sid": "PN0b9c2733e2a9ad0c98352b0123456789",
"subresource_uris": {
"notifications": "/2010-04-01/Accounts/ACdeca5d479509eeb8beaba0123456789/Calls/CAaacc78574ae1b9d2bf483f0123456789/Notifications.json",
"recordings": "/2010-04-01/Accounts/ACdeca5d479509eeb8beaba0123456789/Calls/CAaacc78574ae1b9d2bf483f0123456789/Recordings.json",
"feedback": "/2010-04-01/Accounts/ACdeca5d479509eeb8beaba0123456789/Calls/CAaacc78574ae1b9d2bf483f0123456789/Feedback.json",
"payments": "/2010-04-01/Accounts/ACdeca5d479509eeb8beaba0123456789/Calls/CAaacc78574ae1b9d2bf483f0123456789/Payments.json",
"feedback_summaries": "/2010-04-01/Accounts/ACdeca5d479509eeb8beaba0123456789/Calls/FeedbackSummary.json"
}}

MS Team[BETA] API for Message object property type for reaction

I am trying to create the schema for Message API
As per the documentation, the sample response properties for reaction provided are below
Documentation sample response
"reactions": [
{
"reactionType": "like",
"createdDateTime": "2019-01-21T19:55:51.893Z",
"user": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "e1ecb745-c10f-40af-a9d4-cab946c80ac7",
"displayName": null,
"userIdentityType": "aadUser"
}
}
}
]
From the documentation user is Identity type identity set
Identity is of type:
{
"displayName": "string",
"id": "string",
"tenantId": "string",
"thumbnails": { "#odata.type": "microsoft.graph.thumbnailSet" }
}
From the sample response as well as the response from endpoint, tenantId is not present.
There is a difference in sample response/actual endpoint response and documented properties:
The one with tenantId or one without tenantId.
The user is 1 level as per property documentation but as per actual response and sample response user property has user with in.
What is the correct schema of reaction property that we should consider, because we see variation in documentation vs actual response ?
ok, I think I understand - you're just asking what you should be coding for / expecting, when you query the api. It looks to me like the first link you've posted is the more correct, but you can verify this by using the Graph Explorer. This response does NOT bring back "tenantId", but you haven't explained if you -need- tenantId. If so, there are other ways to get it.
#KritikaVohra, Consider the response that you receive from the https://graph.microsoft.com/beta/teams/{id}/channels/{id}/messages. You don't need tenant id here. in case in conversation if you need it, you can use it from turnContext.

Microsoft Graph Api: Filter by GUID value

I am trying to use Microsoft Graph Api to get the details of a specific user.
I have a problem that can be demonstrated using the Graph Explorer: https://developer.microsoft.com/en-us/graph/graph-explorer
If I run this query:
https://graph.microsoft.com/v1.0/users
I get a list of users, including their ID.
I know I can get the details of just one user by appending the id to the url. For example, this query:
https://graph.microsoft.com/v1.0/users/f71f1f74-bf1f-4e6b-b266-c777ea76e2c7
Results in the details of one specific user.
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
"id": "f71f1f74-bf1f-4e6b-b266-c777ea76e2c7",
"businessPhones": [],
"displayName": "CIE Administrator",
"givenName": "CIE",
"jobTitle": null,
"mail": "admin#CIE493742.onmicrosoft.com",
"mobilePhone": "+1 3528700812",
"officeLocation": null,
"preferredLanguage": "en-US",
"surname": "Administrator",
"userPrincipalName": "admin#CIE493742.onmicrosoft.com"
}
However, in my case, it would be easier to apply a $filter query on the id field.
Here is what I have tried, and the errors I get:
Attempt One
.../users?$filter=id eq f71f1f74-bf1f-4e6b-b266-c777ea76e2c7
Returns the following message:
A binary operator with incompatible types was detected. Found operand types 'Edm.String' and 'Edm.Guid' for operator kind 'Equal'.
Attempt Two
..../users/$filter=id eq guid'f71f1f74-bf1f-4e6b-b266-c777ea76e2c7'
Returns the following message:
Unrecognized 'Edm.String' literal 'guid'f71f1f74-bf1f-4e6b-b266-c777ea76e2c7'' at '6' in 'id eq guid'f71f1f74-bf1f-4e6b-b266-c777ea76e2c7''.
Finally figured it out.
Simply wrap the guid in single quotes, with no other annotations.
https://graph.microsoft.com/v1.0/users?$filter=id eq 'f71f1f74-bf1f-4e6b-b266-c777ea76e2c7'

Create Plan (BETA) doesn't seem to work

I'm trying to create a planner plan using Graph as per http://graph.microsoft.io/en-us/docs/api-reference/beta/api/user_post_plans
but I'm consistently getting the following BadRequest response:
"error": {
"code": "BadRequest",
"message": "Write requests are only supported on contained entities",
"innerError": {
"request-id": "eae08944-6f47-477e-9950-ade31c473dd7",
"date": "2016-03-07T11:59:04"
}
As per the docs I'm POSTing to https://graph.microsoft.com/beta/me/plans with the following body:
"createdBy": "<my uuid>",
"owner": "<a previously generated group uuid>",
"title": "Blah Plan"
with no luck. The previously generated group looks like the following:
{
"id": "<uuid>",
"classification": null,
"createdDateTime": "2016-03-07T09:53:26Z",
"description": "Int Test",
"displayName": "Int Test",
"groupTypes": [
"Unified"
],
"mail": "<email_address>",
"mailEnabled": true,
"mailNickname": "IntTest",
"onPremisesLastSyncDateTime": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"proxyAddresses": [
"SMTP:<email_address>"
],
"renewedDateTime": "2016-03-07T09:53:26Z",
"securityEnabled": false,
"visibility": "Public"
}
I've tried various combinations of request bodies. With and without createdBy values. With and without owner values. Nothing seems to work.
Any ideas where I'm going wrong? The error is consistent across my integration tests as well as through the graph explorer.
Thanks
As Sriram mentioned, this was a documentation bug. It has just been fixed. The updated URL is: https://graph.microsoft.io/en-us/docs/api-reference/beta/api/plan_post_plans
The issue was in which endpoint to call to create a plan. You should call "/plans" instead of "/me/plans". You should also be aware that some of the data you are passing in is read-only. You should not include "createdBy" because this is a read-only property set by the service, not you. The plan resource documentation will show you all of the properties that can be set on a plan.
The last thing to keep in mind is that you can only have one plan per group. If you try to make a second plan, you'll receive an error about this from the API.
In Juli 2017 the API was modified and released. The new endpoint for creating a plan now is:
https://graph.microsoft.com/v1.0/planner/plans
with a request body e.g. like this:
{
"owner": "<group-id>",
"title": "my plan title"
}
where <group-id> must be the id of a previously created group.
Apologies for the confusion here. The documentation has a bug will be updated shortly. To create a plan, please ensure that a group is created, and the user is member of group. Then create the plan with owner set to group id, and createdBy set to user id.
For this issue, can you please try following the below steps exactly?
Create a unified group
Add user to be member of unified group
Create plan by sending {“owner”: group-id, “title”: string} - do not send "createdBy" field since it's a read-only field
For adding tasks to buckets, it should work just fine if you sent
{“planId”: plan-id, “bucketId”: bucket-id, “title”: string}
If this still doesn't work, feel free to reach out to me at lixian#microsoft.com.
Thanks,
Sean

Resources