graph explorer, swagger how to use
** please, login to microsoft **
afterward you can retrieve "Access token"
TOKEN=eyJ0eXAiOiJKV1QiLCJub25jZSI6I...
curl 'https://graph.microsoft.com/v1.0/me/joinedTeams' -H "Authorization: Bearer $TOKEN" | jq .
find out one of the channel and retrieve "id" of it, like: "id": "45626dcc-04da-4c2f-a72a-b28b",
GROUP_ID=45626dcc-04da-4c2f-a72a-b28b
curl https://graph.microsoft.com/v1.0/groups/$GROUP_ID/members -H "Authorization: Bearer $TOKEN" | jq .
curl https://graph.microsoft.com/v1.0/teams/$GROUP_ID/channels -H "Authorization: Bearer $TOKEN" | jq .
retrieve value.id of the channel, like: "id": "19:lApNBJeeI0aFWXNa7dqlbODC2ZkpwMYl8@thread.tacv2",
CHANNEL_ID="19:lApNBJeeI0aFWXNa7dqlbODC2ZkpwMYl8@thread.tacv2"
curl https://graph.microsoft.com/beta/teams/$GROUP_ID/channels/$CHANNEL_ID/messages -H "Authorization: Bearer $TOKEN" | jq .value[].body.content
copy url to channel ( right click on the channel: copy link to channel )
Example: https://teams.microsoft.com/l/channel/19:b4YSMfxxxxxxxxxx@thread.tacv2/Allgemein?groupId=ab123bab-xxxx-xxxx-xxxx-xxxx242b&tenantId=ab123bab-xxxx-xxxx-xxxx-xxxxxx198 channel_id="19:b4YSMfxxxxxxxxxx@thread.tacv2"
team-id == groupId
team_id="ab123bab-xxxx-xxxx-xxxx-xxxx242b"
curl -H "Authorization: Bearer $TOKEN" -X POST https://graph.microsoft.com/v1.0/teams/${team_id}/channels/${channel_id}/messages -H "Content-type: application/json" --data '
{
"body": {
"content": "Hello from Robot"
}
}'