Search code examples
javascriptnode.jsskypebotframeworkskypedeveloper

How to send chat message using skype BOT api


I want to send messages,images ... using skype BOT API. If there is any other NPM available for doing skype chat.

Refer how to get access token from the docs

https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-protocols-oauth-code/

Then using this token i will try to send message using the following request

Refer docs:

https://docs.botframework.com/en-us/skype/chat/#navtitle

conversationId: 29:f2ca6a4a-93bd-434a-9ca5-5f81f8f9b455

  request({
        url: 'https://api.skype.com/v3/conversations/29:f2ca6a4a-93bd-434a-9ca5-5f81f8f9b455/activities',
        method: "POST",
        json: true,
        headers: {
           Authorization: ' Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjIifQ.eyJpYXQiOjE0NzMzMTk4MDEsImV4cCI6MTQ3MzQwNjqwqwqwqwt5cGVpZCI6ImFtdF8wNjIiLCJzY3AiOjk1OCwiY3NpIjoiMCIsImNpZCI6ImVhODhhYWFmMmFkMjYwYzEiLCJhYXQiOjE0NzMzMTk4MDF9.ZrC0weALCz7QbUHFslJZD7L16k_ciFSCNY-q29h99x70qNrpB5e71KYrD18FTZ-3tI8Ck37_91yMHleQZvEziyEq5-t9EOaGM32RiF0iwnKZcbkOkvgqofWmcGdPT63HEyjWBHg3e_NLIE-RnDob4vMCQrHTkqmuQq6cVaIDkjke1Yi4xjONUNIB9QpWmpuRju0Kxi7oIJqiHWQK',
           'Content-Type': 'application/json'
        },
        body: {
            "type": "message/text",
            "text": "Hi! (wave)"
            }
        }

But got error:

  { status: { code: 40499, text: 'No handler found for resource' } }

How to get conversationId?


Solution

  • You are addressing different domain. url should be https://apis.skype.com/v3....