How do I get the Organization name from the Desire2Learn API?
The name attribute of the json returned for org info has the name.
Related
I'm developing an Outlook add-in, in which I grab the mailbox item id and send it to an API. The API uses the Microsoft Graph SDK to fetch the message item by the given id. This scenario worked fine so far, but now I'm struggling with a strange format mismatch between the id I get from Office.js and the id from Graph.
Office.context.mailbox.item.itemId returns ...MlPrBwD/Cohwu0F...
Graph returns ...MlPrBwD-Cohwu0F
So Office.js returns the id containing /C where Graph returns -C in it.
Any ideas?
I'm not sure but I think that the id returned by Office.context.mailbox.item.itemId is an EWS item id.
You can convert it to rest/graph item id by using Office.context.mailbox.convertToRestId.
I'm using twitter API tweepy and I want to use api.list_timeline() function.
It says I must provide either a list ID or slug and owner.
How can I get these information?
The id of a twitter list can be found by looking at end end of the URL of the list on twitter web, for example in the url https://twitter.com/i/lists/1269293736644796416, 1269293736644796416 would be the id.
To implement it into your code you would simply write:
api.list_timeline(list_id=1269293736644796416)
In Microsoft Graph API, how do you retrieve a specific mail using the Id (Mail ID)?
This is what I tried :
$filter => "Id eq 'AQMkADYwZWEyZDQy...someRandomID'"
but the response I get is the property id does not support filtering
Yes. The property 'Id' does not support filtering for List messages.
You should retrieve a specific mail using the Id (Mail ID) through Get message.
GET https://graph.microsoft.com/v1.0/me/messages/{Mail ID}
From the documentation, I can't find any ways to get the siteId of the site where I put the webpart in.
For example,
My current site is: https://{hostname}/sites/main1 <-- NOT root site, but I want to get this siteId
and I test my webpart here: https://{hostname}/sites/main1/_layouts/15/workbench.aspx
How can I achieve this? From the documentation,
A site is addressed be a unique identifier which is a composite ID of the following values:
Site collection hostname (contoso.sharepoint.com)
Site collection unique ID (guid)
Site unique ID (guid)
I can get the hostname easily by using location.hostname (Yes, I am using JavaScript + React to build my webpart) but how to get the site-id easily with Graph API?
Try this: https://graph.microsoft.com/v1.0/sites/{hostname}:/sites/{path}?$select=id
For example:
https://graph.microsoft.com/v1.0/sites/cie493742.sharepoint.com:/sites/Contoso/Operations/Manufacturing?$select=id (this one you can try on the Graph Explorer.
What you get back in the id is in this format:
{hostname},{spsite.id},{spweb.id}
For more info here is the link to the docs: https://learn.microsoft.com/en-us/graph/api/resources/sharepoint?view=graph-rest-1.0
You don't need to do a Graph API call to get the siteId of the current site. It is available in the PageContext.
In the main class of your webpart you can find it at:
this.context.pageContext.site.id
On classic sites using spPageContextInfo:
(location.host + "," + _spPageContextInfo.siteId + "," + _spPageContextInfo.webId).replace(/[\{\}]/g, "")
Execute the below query in Graph explorer
https://graph.microsoft.com/v1.0/sites/{tenantname}.sharepoint.com:/sites/{sitename}
replace the tenantname and sitename placeholders.
The key 'Id' in the JSON response holds the site Id value
Another way you can get the Site-id by below Graph Http Get API.
https://graph.microsoft.com/v1.0/sites
I've to call this Twitter API's method
https://api.twitter.com/1.1/lists/statuses.json?list_id=12345
to retrieve the tweets by the user in the list.
But my customer provide me only the name of the list and I've no idea how to get the list id using the list name.
The list is this: https://twitter.com/DatasportNews/lists/i-campioni-di-brasile2014.
I've tried with this method
https://api.twitter.com/1.1/lists.json?screen_name=i-campioni-di-brasile2014
to get the id list but always return this message
{"errors":[{"message":"Your credentials do not allow access to this resource","code":220}]}.
I'm logged with api key and api secret and get the token well, but this method doesn't work.
Ideas ?
The list name in the URL is referred to as the slug. When you want to request statuses from a list using a slug, you simply also need to pass the owner_screen_name.
For example, in your case:
/1.1/lists/statuses.json?slug=i-campioni-di-brasile2014&owner_screen_name=DatasportNews
More details on this are on the endpoint's doc page at https://dev.twitter.com/docs/api/1.1/get/lists/statuses