Unable to access bot framework Apis

Pankaj Rana 0 Reputation points
2024-05-15T11:18:34.1966667+00:00

I'm trying to access conversation api to get reply from bot but getting 401

i have created a bot using below link
https://dev.botframework.com/

reply_message = {
        "type": "message",
        "from": {"id": bot_id, "name": bot_name},
        "conversation": {"id": conversation_id},
        "recipient": {"id": user_id, "name": user_name},
        "text": message,
        "replyToId": reply_to_id
    }
    url = f"{service_url}v3/conversations/{conversation_id}/activities"
 
    response = requests.post(
        url,
        headers={
            "Authorization": "Bearer " + access_token,
            "Content-Type": "application/json"
        },
        json=reply_message
    )

I'm passing JWT token generated from following end point
scope : https://api.botframework.com/.default
https://login.microsoftonline.com/TenentID/oauth2/v2.0/token

decode JWT getting
{

"aud": "https://api.botframework.com",
.....
}

kindly help me in this

i ref this document
https://learn.microsoft.com/en-us/previous-versions/azure/bot-service/rest-api/bot-framework-rest-connector-send-and-receive-messages?view=azure-bot-service-3.0

Microsoft Security Microsoft Graph
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.