How to add PDF-Viewer Tab to Channel in Microsoft Teams? - microsoft-graph-api

Adding a PDF-Viewer tab to present/show a Sharepoint document has been working before.
I've tried this in January and it seemed to be an easy task - just get the DriveItem ID and URL (from GET /groups/{group-id}/drive/items/{item-id}) and edit the sample from the API Reference with these values (https://learn.microsoft.com/de-de/graph/teams-configuring-builtin-tabs#word-excel-powerpoint-and-pdf-tabs).
Now, that i want to use this, it doesn't work anymore ;-( The tab is created, added to channel, the name of the file shows BUT there is no document!!! What am i missing? Has the format changed? Has someone lately gotten this to work???
Please let me know, how! ;-)
ps: there is no description of the property "entityID" that makes any sense, can anyone explain it?
result in teams

Got the answer, was a Syntax problem!
The "contentURL" property needs to be unescaped (in this case the "%20"). It is that simple after all ;-)
Also i found out, the "entityID" property has no meaning for the File used. It can be "null" actually! I still use the ItemID i got from the DriveItem of the File.
For unescaping i used:
string contentUrl = Uri.UnescapeDataString(webUrl);

If it wasn't for this post I would have not gotten it figured out, so thank you!
For me I ended up having to make entityID null, just unescaping the contentURL didn't do it for me alone.

Thanks for your comment. leaving entityID null fixed my isse also.
I opend an issue to have the docs fixed!

Related

Error: 'Imported XML Content cannot be parsed'

Here's what I'm doing:
=IMPORTXML("https://www.predictit.org/api/marketdata/markets/7164", "/MarketData/Contracts/MarketContract/ID")
The other answers I've seen about this have said that Javascript would be the issue, but the page in question seems to load without it, and I've tried using IMPORTJSON and IMPORTFROMWEB to no avail.
Please help!
You are input incorrect parameter for the xmlpath, a proper formula should be as following and you need to spend sometime to find the correct xmlpath to extract the specific string or information you want,
=IMPORTXML("https://www.predictit.org/api/marketdata/markets/7164","//a/#href")
Here is one example from Google:
=IMPORTXML("https://en.wikipedia.org/wiki/Moon_landing", "//a/#href")

Office 365 Calendar API

I am new to Office 365 api. I got online and tried to used the microsoft virtual academy and other similar to it. I followed the direction from this site linkhttps://msdn.microsoft.com/office/office365/howto/authenticate-and-use-services; step for step, but I am getting an error that looks like thisError message
The steps are not hard at all. When I go into debug mode these two lines always come back null. There is very little information out there about these two lines.
var signInUserId=ClaimsPrincipal.Current.FindFirst(ClaimTypes.Email).Value;
var userObjectId = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value;
If you are looking for my code it is provided in the link I gave above. Those are all my files. To the T. Thanks in advance for any help.
Question 1. Do anyone have better resources other than the ones I am using
Question 2. Can those lines be null.
Question 3. Where can I find a SOLID tutorial online that works 100%
The error is because that there is no “mail” type data in the claims. To construct the AuthenticationContext object, we should use the ‘ClaimTypes.NameIdentifier’ as the ’signInUserId’ instead of ‘ClaimTypes.Email’.
And you can refer to the whole sample code from here.

nokogiri and the href label

I am not sure how to access the label part of the anchor href tag. The other question that looks at this doesnt really answer it for me.
I have this code:
#name = page.css("#content").css("a")[1]
Which gives this result
generation xerox
I want to get at the "generation xerox" bit
I wouldnt mind getting at the href, I dont understand that either. I have read several other SO questions but I can't get it to work
Thanks in advance all
You can access the label with #name.text and the link with #name['href']
See doc

Magento Categories URL

cant seem to find anything related to this on Google. Though maybe I’m not searching the right keywords.
On Magento 1.6 I have a category I created. For example, "test". The seo url for that would have been:
mysite.com/test/
I then deleted the category(stupidly) and later recreated it. Now the category is called:
mysite.com/test-1/
Is there any way to reset the internal index or something so that I can once again have the url:
mysite.com/test/
Hope that makes sense and someone can help.
Thanks a lot for reading.
have you tried to write "test" in the "URL Key" field ?
This behavior has something to do with the "redirect 301" flag.
Bye
Giuseppe

Youtube API - Order newsubscriptionvideos by publishdate

can someone tell me how to order this feed by date?
http://gdata.youtube.com/feeds/base/users/USERNAME/newsubscriptionvideos?alt=json
This does not work oO
http://gdata.youtube.com/feeds/base/users/USERNAME/newsubscriptionvideos?orderby=published&alt=json
Thanks in advance!
Peter
Not sure if you've figured this out. But it seems to work fine for me. I just added the orderby=published.
And I'm using "users/default/newsubscriptionvideos" instead of actually specifying the username. Maybe that makes a difference.

Resources