Smartsheet-API links out data is blank - smartsheet-api

When I attempt to extract the links out from a cell, I get "null" for cells that do not have links and something like this for the ones that do:
{"sheetId": null, "rowId": null, "columnId": null, "sheetName": null, "status": null}
This is the same regardless of if the cell links out to a single destination or multiple ones.
I retrieve a row and then run through each cell in the row.
The entire cell's JSON looks like this (with column ID masked)
{"columnId": XXXXXX, "strict": true, "formula": null, "displayValue": "Yellow", "conditionalFormat": null, "linksOutToCells": {"sheetId": null, "rowId": null, "columnId": null, "sheetName": null, "status": null}, "value": "Yellow", "columnType": null, "linkInFromCell": null, "format": null, "hyperlink": null}
Is there another way to retrieve the outgoing link information?
I'm using Python and SDK 2.0.10
Craig

linksOutToCells should be deserialized as a list. This change will be made in a soon to be released pip. If you need to pick this up before the updated pip, here is a link to the github commit:
https://github.com/smartsheet-platform/smartsheet-python-sdk/commit/bf41069fd17cfc950f1b7eb25338be3805eda084

It appears we have a bug in deserialization. More shortly...

Related

MS Graph API - Create Online Meeting, not generating with dial-in/conference information

I am calling to the MS Graph API to generate a Teams meeting, I previously was doing this same thing but with Application permissions, which MS has decided to deprecate. So I am now setting things up to do this call using User permissions, the new correct way to do it.
I finally got the call itself working in my environment, however I am only getting a URL to join the meeting, no Dial-in or Conference ID so that users can call in from a phone. I've ensured that the account I'm using to generate the meetings is set up with a license for Teams and a Microsoft Audio Conferencing license, but still cannot get Audio Conferencing to return anything other than NULL in the return.
Here's the call I am making to the /beta/me/onlineMeetings endpoint
POST /beta/me/onlineMeetings HTTP/1.1
Host: graph.microsoft.com
Content-Type: application/json
Authorization: Bearer (Token Removed)
{
"startDateTime":"2020-04-14T13:38:34.2444915-07:00",
"endDateTime":"2020-04-14T15:00:34.2464912-07:00",
"subject":"User Token Meeting"
}
And here is the main body of the result I get back from Graph:
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#users('REDACTED')/onlineMeetings/$entity",
"id": "REDACTED":meeting_NTMyZDEwMzYtY2NmZC00MzVlLTgxNDQtZjYxNDJhYjUxNTY4#thread.v2",
"creationDateTime": "2020-04-14T19:38:11.4760719Z",
"startDateTime": "2020-04-14T20:38:34.2444915Z",
"endDateTime": "2020-04-14T22:00:34.2464912Z",
"joinUrl": "REDACTED URL",
"joinWebUrl": "REDACTED URL",
"subject": "User Token Meeting",
"isBroadcast": false,
"autoAdmittedUsers": "Everyone",
"outerMeetingAutoAdmittedUsers": null,
"capabilities": [],
"videoTeleconferenceId": "REDACTED",
"externalId": null,
"audioConferencing": null,
"meetingInfo": null,
"participants": {
"organizer": {
"upn": "REDACTED UPN",
"identity": {
"phone": null,
"guest": null,
"encrypted": null,
"onPremises": null,
"applicationInstance": null,
"application": null,
"device": null,
"user": {
"id": "REDACTED USER ID",
"displayName": null,
"tenantId": "REDACTED TENANT ID",
"identityProvider": "AAD"
Just curious if anyone else is using this call and running into the same issues, or if you know if I need to specify anything in the actual call to Graph to tell it to generate Audio Conferencing as well?
This appears to be working now. My best guess is that I hadn't given the Audio Conferencing license enough time to replicate in our environment.

Pull request's comments list are not coming by using Azure DevOps rest api

I am using Azure DevOps rest api for getting all the comments of the every pull request. I have go through Microsoft documentation. I followed same. But when i see my json response, it does not show list of comments. it is getting following result as i fire get request.
official url given in documentation
https://dev.azure.com/myorg/_apis/git/repositories/jd7489eiu-e5bb-37f7-kl05-098kd4dd/pullRequests/192/threads/{threadId}/comments?api-version=5.1"
I tried following urls for acheive my result
https://dev.azure.com/myorg/_apis/git/repositories/jd7489eiu-e5bb-37f7-kl05-098kd4dd/pullRequests/192/threads?api-version=5.1"
returning comments are empty
{
"pullRequestThreadContext": null,
"id": 1341,
"publishedDate": "2019-02-05T13:15:20.903Z",
"lastUpdatedDate": "2019-02-05T13:15:20.903Z",
"comments": "",
"threadContext": null,
"properties": "#{BypassPolicy=; BypassReason=; CodeReviewStatus=; CodeReviewStatusUpdateAssociatedCommit=; CodeReviewThreadType=; CodeReviewStatusUpdatedByIdentity=}",
"identities": "#{1=}",
"isDeleted": false,
"_links": "#{self=; repository=}"
}
https://dev.azure.com/myorg/_apis/git/repositories/jd7489eiu-e5bb-37f7-kl05-098kd4dd/pullRequests/192/threads/131/comments?api-version=5.1"
Above url is returning same result as above.
https://dev.azure.com/myorg/_apis/git/repositories/jd7489eiu-e5bb-37f7-kl05-098kd4dd/pullRequests/192/threads/131?api-version=5.1"
returning comments are empty
{
"pullRequestThreadContext": null,
"id": 1341,
"publishedDate": "2019-02-05T13:15:20.903Z",
"lastUpdatedDate": "2019-02-05T13:15:20.903Z",
"comments": "",
"threadContext": null,
"properties": "#{BypassPolicy=; BypassReason=; CodeReviewStatus=; CodeReviewStatusUpdateAssociatedCommit=; CodeReviewThreadType=; CodeReviewStatusUpdatedByIdentity=}",
"identities": "#{1=}",
"isDeleted": false,
"_links": "#{self=; repository=}"
}
Did anyone facing the same problem, or know the solution please let me know.

Microsoft Graph API - Get group owner details along with group details in azure

In Azure I could find an API for getting the group details like as shown below
https://graph.microsoft.com/v1.0/groups
which will gives me all the group details like as shown below
{
"value": [
{
"id": "/groups/53c765632095310385020001",
"name": "Administrators",
"description": "Administrators is a built-in group. Its membership is managed by the system. Microsoft Azure subscription administrators fall into this group.",
"builtIn": true,
"type": "system",
"externalId": null
},
{
"id": "/groups/53c765632095310385020002",
"name": "Developers",
"description": "Developers is a built-in group. Its membership is managed by the system. Signed-in users fall into this group.",
"builtIn": true,
"type": "system",
"externalId": null
},
{
"id": "/groups/53c765632095310385020003",
"name": "Guests",
"description": "Guests is a built-in group. Its membership is managed by the system. Unauthenticated users visiting the developer portal fall into this group.",
"builtIn": true,
"type": "system",
"externalId": null
}
],
"count": 3,
"nextLink": null
}
but the problem is I need group owner details also along with group details. At present I calls another API as shown below for getting the group owner details
https://graph.microsoft.com/v1.0/groups/{groupId}/owners
Is there any API or any other way in which I can get the group owner details along with groups details in one shot in azure
Microsoft Graph API supports some optional query parameters like select, filter, expand, search etc. which help in controlling what data you get back in response to your query. You can read about them here
expand parameter might be helpful for your use case.
I quickly tried out a query like below from Microsoft Graph Explorer and it returns the group information as well as owners collection for each group.
https://graph.microsoft.com/v1.0/groups?$expand=owners
Disclaimer: Microsoft Docs for expand parameter have a note which says something like
With Azure AD resources that derive from directoryObject, like user
and group, $expand is only supported for beta and typically returns a
maximum of 20 items for the expanded relationship.
Although, above mentioned query, which uses v1.0 did work fine for me at least from Graph explorer. So do test as much as possible (with high number of groups as well) before starting to rely on it. I'll also update back in case I find more up to date documentation regarding the same.
Here is the exact response I got for query I mentioned above. It's pretty big, I just included 2 groups and removed others, so that you get an idea.
Important part is to notice that owners collection is present along with groups. Notice the first group has no owners assigned, but second group has 2 users as owners.
REQUEST
GET https://graph.microsoft.com/v1.0/groups?$expand=owners
RESPONSE
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"value": [
{
"id": "xxxx-redacted-49b4e13fcf0f",
"deletedDateTime": null,
"classification": null,
"createdDateTime": "2018-09-26T04:41:10Z",
"creationOptions": [],
"description": null,
"displayName": "Business",
"groupTypes": [],
"mail": null,
"mailEnabled": false,
"mailNickname": "xxxx-redacted-88df-adf033b7f545",
"onPremisesLastSyncDateTime": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"preferredDataLocation": null,
"proxyAddresses": [],
"renewedDateTime": "2018-09-26T04:41:10Z",
"resourceBehaviorOptions": [],
"resourceProvisioningOptions": [],
"securityEnabled": true,
"visibility": null,
"onPremisesProvisioningErrors": [],
"owners": []
},
{
"id": "xxxx-redacted-9316-a5acea4412d8",
"deletedDateTime": null,
"classification": null,
"createdDateTime": "2018-09-26T04:19:29Z",
"creationOptions": [],
"description": null,
"displayName": "DevOps",
"groupTypes": [],
"mail": null,
"mailEnabled": false,
"mailNickname": "xxxx-redacted-4f18-b2b1-e5a7b80d19ea",
"onPremisesLastSyncDateTime": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"preferredDataLocation": null,
"proxyAddresses": [],
"renewedDateTime": "2018-09-26T04:19:29Z",
"resourceBehaviorOptions": [],
"resourceProvisioningOptions": [],
"securityEnabled": true,
"visibility": null,
"onPremisesProvisioningErrors": [],
"owners": [
{
"#odata.type": "#microsoft.graph.user",
"id": "xxxx-redacted-8000-8cb9f0d497c9",
"deletedDateTime": null,
"accountEnabled": true,
"ageGroup": null,
"businessPhones": [],
"city": "xxxx",
"companyName": null,
"consentProvidedForMinor": null,
"country": "xxxx",
"createdDateTime": null,
"department": "Human Resources",
"displayName": "Adam G",
"employeeId": null,
"faxNumber": null,
"givenName": "Adam",
"jobTitle": "Senior Human Resource Manager",
"legalAgeGroupClassification": null,
"mail": null,
"mailNickname": "adamg",
"mobilePhone": "xxxx",
"onPremisesDistinguishedName": null,
"onPremisesDomainName": null,
"onPremisesImmutableId": null,
"onPremisesLastSyncDateTime": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSamAccountName": null,
"onPremisesSyncEnabled": null,
"onPremisesUserPrincipalName": null,
"otherMails": [],
"passwordPolicies": "DisablePasswordExpiration",
"passwordProfile": null,
"officeLocation": "131/1105",
"postalCode": "98052",
"preferredLanguage": "en-US",
"proxyAddresses": [],
"refreshTokensValidFromDateTime": "2018-09-19T03:34:39Z",
"imAddresses": [],
"isResourceAccount": null,
"showInAddressList": null,
"state": "MH",
"streetAddress": "xxxxxxxe",
"surname": "Gily",
"usageLocation": "US",
"userPrincipalName": "adamg#xxxxx.onmicrosoft.com",
"userType": "Member",
"assignedLicenses": [],
"assignedPlans": [],
"onPremisesProvisioningErrors": [],
"onPremisesExtensionAttributes": {
"extensionAttribute1": null,
"extensionAttribute2": null,
"extensionAttribute3": null,
"extensionAttribute4": null,
"extensionAttribute5": null,
"extensionAttribute6": null,
"extensionAttribute7": null,
"extensionAttribute8": null,
"extensionAttribute9": null,
"extensionAttribute10": null,
"extensionAttribute11": null,
"extensionAttribute12": null,
"extensionAttribute13": null,
"extensionAttribute14": null,
"extensionAttribute15": null
},
"provisionedPlans": []
},
{
"#odata.type": "#microsoft.graph.user",
"id": "xxxx-redacted-4824-8013-4325f68e275d",
"deletedDateTime": null,
"accountEnabled": true,
"ageGroup": null,
"businessPhones": [],
"city": null,
"companyName": null,
"consentProvidedForMinor": null,
"country": null,
"createdDateTime": null,
"department": null,
"displayName": "groupownertest",
"employeeId": null,
"faxNumber": null,
"givenName": null,
"jobTitle": null,
"legalAgeGroupClassification": null,
"mail": null,
"mailNickname": "groupownertest",
"mobilePhone": null,
"onPremisesDistinguishedName": null,
"onPremisesDomainName": null,
"onPremisesImmutableId": null,
"onPremisesLastSyncDateTime": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSamAccountName": null,
"onPremisesSyncEnabled": null,
"onPremisesUserPrincipalName": null,
"otherMails": [],
"passwordPolicies": null,
"passwordProfile": null,
"officeLocation": null,
"postalCode": null,
"preferredLanguage": null,
"proxyAddresses": [],
"refreshTokensValidFromDateTime": "2019-01-23T18:56:43Z",
"imAddresses": [],
"isResourceAccount": null,
"showInAddressList": null,
"state": null,
"streetAddress": null,
"surname": null,
"usageLocation": null,
"userPrincipalName": "groupownertest#XXXXX.onmicrosoft.com",
"userType": "Member",
"assignedLicenses": [],
"assignedPlans": [],
"onPremisesProvisioningErrors": [],
"onPremisesExtensionAttributes": {
"extensionAttribute1": null,
"extensionAttribute2": null,
"extensionAttribute3": null,
"extensionAttribute4": null,
"extensionAttribute5": null,
"extensionAttribute6": null,
"extensionAttribute7": null,
"extensionAttribute8": null,
"extensionAttribute9": null,
"extensionAttribute10": null,
"extensionAttribute11": null,
"extensionAttribute12": null,
"extensionAttribute13": null,
"extensionAttribute14": null,
"extensionAttribute15": null
},
"provisionedPlans": []
}
]
}
]
}
UPDATE 1 (to answer queries from comments)
members and owners are both navigational properties/relationships and not direct properties for groups. You can only expand one at a time. I'll show you 3 quick api calls that can be tested from Microsoft Graph Explorer.
expand only members - This works as expected and returns groups as well as members for each group.
GET https://graph.microsoft.com/v1.0/groups?$expand=members
expand only owners - This works as expected and returns groups as well as owners for each group. Sample response shown above already.
GET https://graph.microsoft.com/v1.0/groups?$expand=owners
expand both members and owners in a single call
GET https://graph.microsoft.com/v1.0/groups?$expand=members,owners
RESPONSE
you can only expand one navigational property in a single call.. look at the error message it's quite intuitive:
{
"error": {
"code": "Request_BadRequest",
"message": "The result of parsing $expand contained at least 2 items, but the maximum allowed is 1.",
"innerError": {
"request-id": "119cf794-af56-48a0-b415-4d52c2e60e98",
"date": "2019-02-13T02:57:13"
}
}
}
UPDATE 2 (to answer query about expand and select together from comments)
I don't think you will be able to $select only a few columns along with $expand in the query. This seems to be a known limitation. See the two links below for more context
Query Parameter Limitations - Microsoft Docs
Another SO post
Specifically, in this SO post look at comment from Marc LaFleur and an answer from Dan Kershaw - MSFT
Not sure if this has been fixed, but I was able to limit the output of the expanded owner query with this
https://graph.microsoft.com/v1.0/groups/?$select=displayName&$filter=resourceProvisioningOptions/Any(x:x eq 'Team')&$expand=owners($select=id,department)
note: this was to retrieve specific groups that belonged to Teams, but that's just a filter, I think it should work otherwise as well.

Change FormControl value from object (FormGroup) to null and vise versa in Angular 2

I have a Form object built with FormBuilder. One of the part of the form needs to be changed dynamically:
"Tag":
{
"Id": 10,
"Name": "Program43",
"Source": "DSN"
}
I need to change value in "Tag" to null to have:
"Tag": null
and later in the form to have something like:
"Tag":
{
"Id": null,
"Name": null,
"Source": null
}
Any idea of best approach to do it? What method of angular2 is the best to use for this?
Use AbstractControl#reset method:
const tagGroup = this.FORM.get('Tag');
tagGroup.reset();
console.log(tagGroup.value); // { Id: null, Name: null, Source: null }

Xcode: model adding entities

I am experimenting with API that returns some fields with underscore like _id. I am not able to map this field in the -xcdatamodel. The attribute must begin with letter.
I've also tried to map this field as "id" and provide in the "User Info" session a Key/Value like id : _id but without success.
Do you have a solution for this problem? As i know there are many APIs that have fields with underscore.
Other non underscore fields are mapped without problems.
{
"__v": 0,
"_avRateDelay": 5,
"_avRateRecommend": 5,
"_avRateStaff": 5,
"_id": "530f733df222bf594b190e0a10",
"_reviews": 1,
"active": 1,
"address": {
"city": "Little Rock",
"country": "USA",
"other": "",
"state": "AZ",
"street": "2701 E Roosevelt Rd",
"zip": "72206"
},
"location": {
"lat": 34.721175,
"lng": -92.24168600000002
},
"name": "Certainteed 69"
}
Don't use id or _id in Objective-C. id is a reserved word. Since many servers like to use that I recommend that you write mapping code so that it is mapped from the server id to something like identifier.
Since you need to write code to parse the fields anyway there is no hardship to look for that key and change it. You can even store the mapping in the NSEntityDescription and set up code to look for other mappings and change them. That way you can change other server styled values like created_at to their Objective-C counterparts like createdAt.
The key/values are editable directly in the model editor and then accessible via the -entity property on the NSManagedObject.