Hello,
We placed a manual call to a phone number and it’s showing up in the Developer Web API, but not in the C# client (code below). We decided to try and not use the C# SDK and make a straight POST, but it’s not quite clear how Auth is done as per the documentation. It would be great to get a sample POST so that we can get a token (we’ve only ever used the SDK). It would be even better if the SDK worked.
var dailyConversationQuery = new ConversationQuery()
{
Interval = "2020-09-15T00:00:00.000Z/2020-09-16T00:00:00.000Z",
};
AnalyticsConversationQueryResponse conversationQuery = outbound.PostAnalyticsConversationsDetailsQuery(dailyConversationQuery);
I am using the following SDK API to generate an access token:
Configuration.Default.AccessToken = Configuration.Default.ApiClient.PostToken(clientId, clientSecret).AccessToken
The parameters I’m passing are the clientId and clientSecret. It works for the APIs that are using the SDK. The auth error we are receiving pertains to making manual API calls and adding the configuration token to a header. The token shows a value so we’re unsure of what the issue is.
System.FormatException: The header name format is invalid.
This is how the header is being formatted:
client.DefaultRequestHeaders.Add( "Authorization: Bearer" , Configuration.Default.AccessToken);
Please advise.
thanks!
Peter