Hi,
I'm trying to get an image from the body of a teams message.
I know the image is stored in a location similar to this one:
From this URL I want to get the image data and convert it to base64 (if needed) in order to then write it to a CDS record.
Any help appreciated, thanks.
Hi @mrpowergage
Find this similar issue that had a solution in it
Hope this help.
-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Any one any ideas on this ? The issue is that the image is not an attachment, it is in the body of the message. See the JSON, the image source is in body.content attachments is empty. When I try and use the URL from the source I get an authentication error.
{
"id": "1584227000439",
"replyToId": null,
"etag": "1584227185891",
"messageType": "message",
"createdDateTime": "2020-03-14T23:03:20.439Z",
"lastModifiedDateTime": "2020-03-14T23:06:25.891Z",
"deletedDateTime": null,
"subject": null,
"summary": null,
"importance": "normal",
"locale": "en-us",
"webUrl": "https://teams.microsoft.com/l/message/19%3A31bf2ce9492f45d982681d3f1159657f%40thread.skype/1584227000439?groupId=eeca1618-16f7-40de-a401-bb1cfce7e9c4&tenantId=d838ff12-f626-4a30-b05e-aa4364197307&createdTime=1584227000439&parentMessageId=1584227000439",
"policyViolation": null,
"from": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "7a61d448-27a6-4196-8f7e-80e0aecb1471",
"displayName": "XXXX",
"userIdentityType": "aadUser"
}
},
"body": {
"contentType": "html",
"content": "<div><div>\n<div>Test stuff<br>\n\n<img src=\"https://graph.microsoft.com/beta/teams/eeca1618-16f7-40de-a401-bb1cfce7e9c4/channels/19:31bf2ce9492f45d982681d3f1159657f@thread.skype/messages/1584227000439/hostedContents/aWQ9LHR5cGU9MSx1cmw9aHR0cHM6Ly91ay1hcGkuYXNtLnNreXBlLmNvbS92MS9vYmplY3RzLzAtc3VrLWQxLWZmMTE1YzZiYmQ1Zjk4MWY3YmM2YmJhMjkyMDBiZjYzL3ZpZXdzL2ltZ28=/$value\" style=\"width:800px; height:600px\"><br>\n\nReport 2 & 3</div>\n</div>\n</div>"
},
"attachments": [],
"mentions": [],
"reactions": []
},
thanks
hi @mrpowergage this is the full json? Because as you see the link with src image has a variable called Value.
So if we don't know what is in value is going to be imposible to get the image.
You could use parse json to get the "content": that is in json like this.
Proud to be a Flownaut!
Thanks @ChristianAbata
@ChristianAbata wrote:hi @mrpowergage this is the full json? Because as you see the link with src image has a variable called Value.
Yes that's the full json. As you can see the src it is a link to https://graph.micro.... when I visit that link I get
{ "error": { "code": "InvalidAuthenticationToken", "message": "Access token is empty.", "innerError": { "request-id": "2fd192af-c1c6-484a-9f8d-801ce208ed91", "date": "2020-03-15T13:25:06" } } }
I'm guessing I need to find a way to authenticate in order to get that data.
Any ideas??
ok @mrpowergage please follow this post to do that https://sjoukjezaal.com/azure-b2b-sharepoint-online-solution-using-powerapps-flow-and-the-graph-api/
Proud to be a Flownaut!
Many thanks @ChristianAbata
This looks beyond my expertise at this point. I may come back to it, but for now I'm going to find a different way to get the images into the system (probably Kaizala).
Thanks for all help.
@mrpowergage sure Kaizala is more easy.
Proud to be a Flownaut!
Hi mrpowergage
Did you ever get this sorted out? I have the same question.
Regards,
User | Count |
---|---|
33 | |
32 | |
23 | |
22 | |
19 |
User | Count |
---|---|
58 | |
55 | |
41 | |
37 | |
28 |