Getting the error "Mandatory grant_type form parameter missing" in postman - amadeus

Here's the information entered on postman
URL - https://test.api.amadeus.com/v1/security/oauth2/token
Parameters:
grant_type - client_credentials
client_secret - {{My_API_Secret_key}}
client_id - {{My_API_key}}
Headers
Content Type : application/x-www-form-urlencoded
It returns this response :
{
"error": "invalid_request",
"error_description": "Mandatory grant_type form parameter missing",
"code": 38187,
"title": "Invalid parameters"
}

It's a post request. so you should pass these parameters under different type.
For example in python's requests library it would be inside your data:
requests.post("{}/v1/security/oauth2/token".format(url), data=YOURPARAMETERS, headers=YOURHEADERS )

Related

Get error sending POST request to openweathermap via postman

I'm starting to learn the REST API. I use POSTMAN for this and openweathermap.org.
I am sending the name of the city in the body. The body has json format:
{
"cityName" : "Poltava,UA"
}
Response from the server:
{
"cod": "400",
"message": "Nothing to geocode"
}
Please tell me where I am going wrong? I changed the name of the key to "q", "city" and wrote simply "Poltava" and always I get the same error.
API docs: https://openweathermap.org/current
Headers of my request is:
Headers

Amazon Advertising API throws HTTP 401 Unauthorized

I am trying to generate ads reports
The create report API gives response as
{
"reportId": "amzn1.sdAPI.v1.p44571.6153E22B.2825ae5c-126d-422c-bf10-53d2d601189a",
"recordType": "campaigns",
"status": "IN_PROGRESS",
"statusDetails": "Report is being generated."
}
but the get report status API gives UNAUTHORIZED error
{
"code": "UNAUTHORIZED",
"details": "HTTP 401 Unauthorized",
"requestId": "6C1XJ33DSF546P3XZSD"
}
My first suggestion would be to ensure you’re using a valid access token.
You should also verify correct scope value and clientID in your header.

Generating oauth token on sandbox throws ServerError

When generating oauth token from ordercloud sandbox environment, ordercloud returns ServerError as the error. Double checked the client_id, username, password and grant_type and it is correct. I am able to generate token using client_credentials grant_type. Is there a different way to generate token using password grant_type?
"client_id": "827D3F9E-F0AE-4C12-AF55-24D1D526303F",
"grant_type": "password",
"username": "admin02",
"password": "Test1234567#",
"scope": "CatalogAdmin BuyerReader MeAdmin InventoryAdmin PasswordReset OrderAdmin PriceScheduleAdmin ProductAdmin ProductAssignmentAdmin ShipmentAdmin"
"ErrorCode": "ServerError",
"Message": "An unknown error has occurred on the server.",
Your API Client has a ClientSecret set and you are not passing the ClientSecret in the request body. If you remove the ClientSecret, or pass it in the request body, your call should succeed.
It should be returning a 400 though rather than 500, so I will log that as a bug on our end.

The request's Authentication (Server-) Key contained an invalid or malformed FCM-Token (a.k.a. IID-Token). Error 401

try to POST FCM from Postman, but got error message
"The request's Authentication (Server-) Key contained an invalid or malformed FCM-Token (a.k.a. IID-Token).
Error 401"
note: copy auth key from Project credentials-Server key
url : https://fcm.googleapis.com/fcm/send
header
Content-Type : application/json
Authorization : key=AAAAQJ50ukk:Gf9m5PCwpwb1EG .....aovqy
Body :
{
"to": "",
"data":
{
"title":"Test"
"message":"Test Message"
}
}

"No session ID found " - Yodlee login API

I get "No session ID found " on Yodlee login API call. Although I am passing correct cobSessionToken.
Endpoint: https://rest.developer.yodlee.com/services/srest/restserver/v1.0/authenticate/login
I am passing input parameters in body
{"cobSessionToken":"08062013_0:a401c173dc5440a4d1844623b85b3aa0113e8888cefade55da62fee5bfb029500ed82a272bc8c11a44f42eb55832c1eebdc5503ff06fda9bbc62b91192acd984",
"login":"*******","password":"*******"
}
Response:
{
"Error": [
{
"errorDetail": "No session ID found "
}
]
}
In login and password input parameter, I had to pass autogenerated test user credentials.
Ex-
login : sbMem(userid)1
password: sbMem(userid)1#123
And content-type should have x-www-form-urlencoded.