Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

The API returns incorrect information with app-only token (Sharing Information)

$
0
0

I make the request in two ways:
(1) with access_token i got with acquireToken (SDK)
(2) with access_token i got with normal way (OAUTH API)


Example:

Method:
POST

URL:
https://xxxxx-my.sharepoint.com/personal/xxxx_yyyyt_onmicrosoft_com/_api/SP.ObjectSharingInformation.GetObjectSharingInformationByUrl?$expand=SharedWithUsersCollection

Body:
{"objectUrl":"https://xxxxx-my.sharepoint.com/personal/yyyy_xxxx_onmicrosoft_com/Documents/xxx/yyyyy/filemaame.pdf","excludeCurrentUser":true,"excludeSiteAdmin":true,"excludeSecurityGroups":false,"retrieveAnonymousLinks":true,"retrieveUserInfoDetails":true}

and i got with access_token (1 - app only token)

{
......
......"SharingLinks": [{"IsActive": true,"LinkKind": 1,"Url": "https://xxxx-my.sharepoint.com/personal/yyyy_xxxxx_onmicrosoft_com/Documents/filename.pdf"
    }, {"IsActive": true,"LinkKind": 2,"Url": "https://xxxxxxxxxxxxxxxxxxxxxx"
    }, {"IsActive": false,"LinkKind": 3,"Url": null
    }, {"IsActive": false,"LinkKind": 4,"Url": null
    }, {"IsActive": false,"LinkKind": 5,"Url": ""
    }],"TotalFileCount": "0"
}

and i got with access_token (2 - oauth2)

{

...............

..............."SharingLinks": [ {"IsActive": true,"LinkKind": 1,"Url": "https://xxxxxxxxxxxxxxxxxxxxxxxxx" }, {"IsActive": true,"LinkKind": 2,"Url": "https://xxxxxxxxxxxxxxxxxxxxxxx8" }, {"IsActive": true,"LinkKind": 3,"Url": "https://xxxxxxxxxxxxxxxxxxxxxxxxxx" }, {"IsActive": false,"LinkKind": 4,"Url": null }, {"IsActive": true,"LinkKind": 5,"Url": "https://xxxxxxxxxxxxxxxxxxxxxxxxx" } ],"TotalFileCount": "0" }


And as you can see I'm getting differences results in LinkKind 3,5 (edit link)




Viewing all articles
Browse latest Browse all 7589

Trending Articles