I'm trying to replace an existing click to dial functionality in a .NET application that currently uses "Skype For Business/Lync" and switch it to "Microsoft Teams". It does not look as though there is many examples of this online. The examples I have found do not seem to work for me. The example to shows up in multiple sources is below:
IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder
.Create(clientId)
.WithTenantId(tenantID)
.WithClientSecret(clientSecret)
.Build();
ClientCredentialProvider authProvider = new ClientCredentialProvider(confidentialClientApplication);
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
var call = new Call
{
CallbackUri = redirectUri,
Targets = new List<InvitationParticipantInfo>()
{
new InvitationParticipantInfo
{
Identity = new IdentitySet
{
User = new Identity
{
DisplayName = "John",
Id = userId
}
}
}
},
RequestedModalities = new List<Modality>()
{
Modality.Audio
},
MediaConfig = new ServiceHostedMediaConfig
{
}
};
var response = graphClient.Communications.Calls
.Request()
.AddAsync(call).GetAwaiter().GetResult();
This code ultimately returns an error
Message: {"errorCode":"7503","message":"Application is not registered in our store.","instanceAnnotations":[]}
There is not much documentation on this error. I have registered a bot in Azure Active Directory and plugged in all the necessary values into the variables in the snippen above.
I have also attempted to run this code in Postman using the example in this link which also contains the C# example. Postman returns the exact same error.
I can also confirm I have the Calls.Initialte API permissions granted with Admin consent.
Has anyone made a successful outgoing call in C# via Microsoft Graph/Teams?