How to test StartChatContact API in Postman? | "Unable to determine service/operation name to be authorized" - amazon-web-services

I am trying to start AWS connect chat from a third-party application. I have implemented StartChatContact in Postman, which gives a participant token that is further used in CreateParticipantConnection.
StartChatContact
Body
{
"ContactFlowId": "cd1a0465-0a02229-4a1a-9894-fb14945548264",
"InstanceId": "84ece66549-184a-400f-babf-59888d7c8fd04",
"ParticipantDetails": {
"DisplayName": "Customer"
}
}
This is working fine and returns the participant token.
CreateParticipantConnection
Body
{
"ConnectParticipant": true,
"Type": [ "WebSocket" ]
}
When I placed the token in CreateParticipantConnection, it throws an error that is mentioned below:
Error
{
"message": "Unable to determine service/operation name to be authorized"
}
Kindly provide me your valuable guidance. I am following StartChatContact and CreateParticipantConnection documentations.

I haven't tested but I believe the type needs to be "WEBSOCKET" not "WebSocket" i.e. it is case sensitive.

Related

Getting 400 Bad Request error while trying to move Azure resources via Postman

I am trying to move resources from one resource group to another via Postman.
I got the access token successfully by using below parameters:
https://login.microsoftonline.com/mytenantid/oauth2/v2.0/token
client_id='myclientid'
&scope=https://management.azure.com/.default
&grant_type=client_credentials
&client_secret='appclientsecret'
I am using query like below:
POST
https://management.azure.com/subscriptions/mysubscriptionid/resourceGroups/resourcegroupname/moveResources?api-version=2021-04-01
Request Body
{
"resources" : "/subscriptions/mysubscriptionid/resourceGroups/resourcegroupname/providers/Microsoft.KeyVault/vaults/keyvaultname",
"targetResourceGroup" : "/subscriptions/mysubscriptionid/resourceGroups/targetresourcegroupname"
}
But I got error like below:
{ "error": { "code": "UnsupportedMediaType",
"message": "The content
media type 'text/plain' is not supported. Only 'application/json' is
supported."
} }
After changing the type to JSON, I am getting another error like below:
{ "error": { "code": "InvalidRequestContent", "message": "The request
content was invalid and could not be deserialized: 'Error converting
value
"/subscriptions/mysubscriptionid/resourceGroups/resourcegroupname/providers/Microsoft.KeyVault/vaults/keyvaultname"
to type 'System.String[]'. Path 'resources', line 2, position 143.'."
} }
Can anyone help me to resolve this error?
I tried to reproduce the same in my environment and was able to move resources successfully like below:
Make sure your request body is something like below:
{
"resources" : ["/subscriptions/XXXXXXX/resourceGroups/Test/providers/Microsoft.KeyVault/vaults/testkeyvault549","/subscriptions/XXXXXXXXX/resourceGroups/Test/providers/Microsoft.Storage/storageAccounts/sristackdem01"],
"targetResourceGroup" : "/subscriptions/XXXXXXX/resourceGroups/Demo"
}
When I executed the same query, I got below response:
Please note that resources parameter expects list of resource IDs in [ ]. So, make sure to add them.
When I missed giving [ ] as mentioned above, I got the same error as you like below:
Reference:
Validate Azure Resource Move with Postman - Apostolidis Cloud Corner

AWS PinPoint - SMS Message From Postman

I'm trying to initiate a SMS message using Postman, but I keep getting a response indicating "Invalid Request Body". I can't seem to find a good example on the AWS documentation (Is it just me or does anyone else encounter this with AWS?)
Below is the request body I'm submitting with my request. Any help would be much appreciated!
{
"ApplicationId": "<MyApplicationID>",
"MessageRequest": {
"Addresses": {
"[{{Destination}}]": {
"BodyOverride": "Test",
"ChannelType": "SMS"
}
},
"MessageConfiguration": {
"SMSMessage": {
"Body": "Test",
"SenderId": "Test",
"MessageType": "TRANSACTIONAL",
"Keyword": "<MyKeyword>",
"OriginationNumber": "<Origination number in E.164 Format>"
}
}
}
}
Looking at the Amazon Pinpoint SendMessages REST API, the request body doesn't include either the application-id key or MessageRequest key.
Resolution:
You will need to put the Amazon Pinpoint application-id in the URI part (or create an environmental variable) and then specify the request body as shown below :
Hope this helps!

Clickatell - WhatsApp Template - One API

I try to send a WhatsApp template message using the Clickatell One API end point.
Here is my payload. I'm send this against the endpoint with POST.
{
"messages":[
{
"to":"***********",
"channel": "whatsapp",
"hsm" : {
"template":"welcome_notification_demo",
"parameters" : {
"1":"John",
"2":" Clickatell"
}
}
}
]
}
I receive the following response from them:
{
"messages": [
{
"error": {
"code": 23,
"description": "Invalid or missing parameter: HSM ."
},
"accepted": false,
"to": "*********"
}
],
"error": null
}
Can anyone tell me what I am missing in my payload?
(The documentation is not at all useful.)
Note: I used ********** to hide my phone number.
Thanks!
From the support team:
"The cause of the error is that you are attempting to send a Default Whatsapp Template from a verified Whatsapp Business Number. Please retest by using one of your approved custom templates and advise us if the issue continues."
So I tried with one of our custom templates and it worked!
(Would be nice if the documentation mentioned that you can't test with a default template)

PowerBI Creating embed token for accessing dataset shouldn't have effective identity

I am getting error while trying to generate embed token for Power BI dashboards embedded in a custom app
POST : https://api.powerbi.com/v1.0/myorg/groups/{groupId}/dashboards/{dashboardId}/GenerateToken
Request Body
{
"accessLevel": "View",
"identities": [
{
"datasets": [
"f7b28b55-xxxx-xxxx-xxxx-93bcb5067f50"
]
}
]
}
Error
{
"error": {
"code": "InvalidRequest",
"message": "Creating embed token for accessing dataset f7b28b55-xxxx-xxxx-xxxx-93bcb5067f50 shouldn't have effective identity"
}
}
If we read error message carefully it has been mentioned "shouldn't have effective identity", which simply means it should not require identity to be passed in request body, API invocation will work after removing identities section like below :
{
"accessLevel": "View"
}

Call to managedDevices return an error in POSTMAN but works in PowerShell

I do a GET with a valid token to
https://graph.microsoft.com/beta/deviceManagement/managedDevices
and I get this error:
{
"error": {
"code": "UnknownError",
"message": {
"ErrorCode": "Forbidden",
"Message": {
"_version ": 3,
"Message": "An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: c0edc6b3-3d79-431f-b224-b034524e565c - Url: https://fef.msua02.manage.microsoft.com/DeviceFE/StatelessDeviceFEService/deviceManagement/managedDevices?api-version=5018-07-19",
"CustomApiErrorPhrase": "",
"RetryAfter": null,
"ErrorSourceService": "",
"HttpHeaders": {
"WWW-Authenticate": "Bearer realm=urn:intune:service,f0f3c450-59bf-4f0d-b1b2-0ef84ddfe3c7"
}
},
"Target": null,
"Details": null,
"InnerError": null,
"InstanceAnnotations": []
},
"innerError": {
"request-id": "c0edc6b3-3d79-431f-b224-b034524e565c",
"date": "2018-09-21T15:27:35"
}
}
}
If I do the same thing using PowerShell with sample code from Microsoft, I successfully get the list of devices.
Has anyone experienced the same issue?
I figured out what was wrong. The token we were getting was working for application permission access like getting devices and users in AAD but not delegated permissions like managedDevices. I talked to our AAD team and they are supposed to give us a way to generate the correct token.
I had the same error, and found I had to add the following 3 permissions in Azure to get it working;
https://graph.microsoft.com/DeviceManagementManagedDevices.Read.All - Delegated
https://graph.microsoft.com/User.Read - Delegated
https://graph.microsoft.com/DeviceManagementManagedDevices.Read.All - Application