I am trying to write a nodeJS code which sends a simple notification to a Skype for Business account using the UCWA web API but I am not succeeding.
The customer uses Skype for Business 2015 on-premises.
To implement that I followed the link bellow: https://www.matthewproctor.com/Send-An-IM-With-UCWA-Sending-the-IM/
It looks like I completed the part 2 successfully.
On the part 3 I am supposed to be able to send the message, the process starts by requesting the following URL using the method POST: /ucwa/oauth/v1/applications/1023*********/communication/messagingInvitations
Bellow the POST data example:
{
"importance":"Normal",
"sessionContext":"33dc0ef6-0570-4467-bb7e-49fcbea8e944",
"subject":"Sample Subject Line",
"telemetryId":null,
"to":"sip:scottgu@contoso.com",
"operationId":"5028e824-2268-4b14-9e59-1abad65ff393"
}
Question 1: Does someone knows where do I get the operationId param from? It wasn't clear for me when the article says it was done on part 1. I am using the example operationId but not sure if it is the cause of not having it working properly on the following steps.
After the request is done, the desktop app of the account I am sending the message pops up on the bottom right of the screen with the account and title I am sending (subject) the request.
The UCWA returned (201 Created) as described on the article, but the body which would return the events URL is blank.
Because I didn't get the events URL I hard-coded it, so I could keep going on the following requests.
Then I call:
/ucwa/oauth/v1/applications/102........../events?ack=1
and
/ucwa/oauth/v1/applications/102........../events?ack=3
(I am replacing the code 102.......... with the application Id I got on the /messagingInvitations request.)
The response of the last request returned a big object which I parsed and I got the _embedded.messaging._links.sendMessage when the state (itemEvents._embedded.messaging.state) is equal 'Connected'.
With the above URL, I make the next request (POST) something like:
<hostname>/ucwa/oauth/v1/applications/10682720060/communication/conversations/f96afecd-8893-4cc2-a972-06bcd0b363cd/messaging/messages
Then I get the response bellow,
{"code":"NotFound","message":"The requested resource couldn\u0027t be found."}
Any help?
Many thanks