Hi,
I have a problem with a chat message received by a personal user account ( therefore different tenant from mine ) with an attachment (I am a business account user).
This is the relevant part of the json object got by GraphAPI ( v1.0/me/chats/<chatId>/messages/<messageId> ) of the chat message I received:
...
"from": {
"application": null,
"device": null,
"user": {
"@odata.type": "#microsoft.graph.teamworkUserIdentity",
"id": "<name>.<surname>_3",
"displayName": "<Name> <Surname>",
"userIdentityType": "personalMicrosoftAccountUser"
}
},
"body": {
"contentType": "text",
"content": "File zip<attachment id=\"b9cbc7dc8d1a3ef3!342\"></attachment>"
},
"attachments": [
{
"id": "b9cbc7dc8d1a3ef3!342",
"contentType": "reference",
"contentUrl": null,
"content": null,
"name": "Test file 8.zip",
"thumbnailUrl": null,
"teamsAppId": null
}
],
...
As you can see inside the property "attachments", "contentUrl" is null and I don't know how get the attachment file by id.
I am not able to find the file inside my oneDrive or shared with me or in hostedContents of the chat.
I see that the attachment id seems like a drive item,
but calling the GraphAPI .../drives/b9cbc7dc8d1a3ef3/items/b9cbc7dc8d1a3ef3!342
I receive an error:
"error": {
"code": "invalidRequest",
"message": "The provided drive id appears to be malformed, or does not represent a valid drive.",
Also calling the GraphAPI .../users/<id>/drives (with the userId I received from chats/<chatId>/members API) to see the drive list of the other user I got an error:
"error": {
"code": "ResourceNotFound",
"message": "User not found",
How can I get this file?
I am able to download it only throught the MsTeams app, and i see that like a link to OneDrive app:
https://1drv.ms/u/s!<alphanumeric_code>
that redirect me to this page:
https://onedrive.live.com/?authkey=<authKey>&id=B9CBC7DC8D1A3EF3%21342&cid=B9CBC7DC8D1A3EF3&parId=root&parQt=sharedby&o=OneUp
I can understand that the attachment id is the same queryString param "id" and the queryString param "cid" is the attachment id without the last part "!<number>".
How can I build/create by my self the <alphanumeric_code>?
Or how can I build/retrieve the <authKey> value?