I have this endpoint:
https://fcm.googleapis.com/fcm/send
and this is Body for this Request:
{
"to":"ecidY6ipLTQ:APA91bEdVPCb5hE_QTI2KC8JN5W7rzk-nIvmWbDK5TMa8PqxQ2_eZ8dA0Ywna8pkltZG2GpcKUZs5n6TUv3X2j_EcwRhqZ_I7YP90ae9ACaeeSdiisCPPOOtr0yJ87voM7_Ws8Ceyxy0",
"expirationTime":null,
"keys":{
"p256dh":"BLVHXS5JMpe4NfrFEKF4h29CkJhDHBkv0YuktLZyOkC-1zu9ZNy6odKLV0HzFGboO7Q_YURFDNif8Gmkgt6nylo",
"auth":"9sgELmiPIWfskF-kEtVHcA"
}
}
I have also
Public Key : BF5zWIcdemV31vfkC7lCRQX5sMGk5OSCCesoE274aekn-QRli4DoPkpNcEqwHFBnViJzhzM3Lbl-rmtKYLzXihk
and
privateKey: '9wAuwA40itA6P8sGk11OYrN4TCc2Aal6iNte2Q5ziyU'
I want execute this Request in post man I dont know where should be Public and private keys
for this Reason I got 401 error Authentication error
I hope your help and thank you so much
Please check in this way you can hit this using post man
first you have to enter your authorization token in bearer token
after that post your data in body as a json check below image it will send the notification and it's showing the status as success
Related
I am sending an API request to get my oauth_token through postman. This is my request:
https://api.twitter.com/oauth/request_token?oauth_callback=oob
where the header is Content-Type:application/json and I am providing API key and secret under the Authorization Tab with OAuth 1.0.
On sending this get request, the request returns the error "Sorry, this page doesn't exist".
Please check the image for reference
I used https://twitter.com/oauth/request_token?oauth_callback=oob and it resolved my issue. Twitter used to use "api.twitter.com" call to authorize API request but they changed back to "twitter.com" which worked for me.
I'm attempting to fetch the bearer token for OroCommerce, via POSTMAN and am encountering a 405 error, for the following request:
URL: http://<OroCommerce DNS>/oauth2-token
Header: Content-Type: application/json
Body:
{
"grant_type": "client_credentials",
"client_id": "XXXX",
"client_secret": "XXXX"
}
I have generated the public and private keys and added them to the /var directory of the application. Per this issue, I have tried "Enabled Guest Access" checked and unchecked. Both result in the same 405 error w/ HTML in the response (see image below). The back-end is up, when attempting these requests. Any suggestions on where to look (configurations, etc), in order to successfully fetch the bearer token, via the REST API?
Response HTML
First of all, make sure an API is enabled: https://doc.oroinc.com/api/enabling-api-feature/.
Then, make sure you are using the POST HTTP method to submit the request.
If it wouldn't help, make sure the maintenance mode is fully disabled. It's step 13 in the upgrade guide: https://doc.oroinc.com/backend/setup/upgrade-to-new-version/#id1
Check the application log at var/logs/prod.log for errors. Usually, the error message explains what is wrong, or at least, you can use it to google the issue.
If nothing works, you can try to access the same endpoint using the dev environment. There should be a more explicit error message with the stack trace. Or enable an xdebug extension and check it step by step.
It's my first time using GraphQL and im trying to access the content of a given query but i can't acces this given query because of lack of permissions, in this case I have been given a username and a password to access this GraphQL api, and i'm able to get and verify the token using these credentials in GraphQL but my question is the following, how do I become authenticated in the API to be able to access the queries of the API?
My error is as follows.
"errors": [
{
"message": "You do not have permission to perform this action",
I believe this is something very basic, but I just not able to find a way to solve this issue.
Click HTTP Header and add your token as shown below:
{
"Authorization": "Bearer YOUR_TOKEN_HERE"
}
you may have to remove Bearer and only use the token, it depends on how you did authorization on the server.
This is for JWT authentication in REQUEST HEADERS on GraphiQL below:
{
"Authorization": "JWT your_jwt_access_token_here"
}
If anyone stumbles upon same issue, just sending the HTTP didn't work in my case, because I had this line in my #auth-directive:
let token = req?.cookies?.token
Which would only check token from cookies and never from request-headers where I was passing the Authorization-header.
Fixed the issue by changing it to:
let token = req?.cookies?.token ?? req?.headers?.authorization
Getting auth token from uber is a two step process.
Please refer Uber Auth API
Ask the uber user to authorize : call GET https://login.uber.com/oauth/v2/authorize?response_type=code&client_id={client_id}&redirect_uri={redirect_uri}
Provide your client_id and redirect_uri specific to your website. If the authorization is successful, you will be redirected to your site with the code in the query parameter.
The the code you get in step 1 to retrieve auth token.
Send an HTTP POST request to https://login.uber.com/oauth/v2/token. Following should be the json you send to server:
{
"client_secret": "{client_secret}",
"client_id": "{client_id}",
"grant_type": "{authorization_code}",
"redirect_uri": "{redirect_uri}",
"code": "{insert authorization code obtained in previous step}"
}
In the step two I always get a error 400 with "invalid grant type" message. Please suggest where am I going wrong.
You need to send the parameter as form-data, not JSON. Take a look at the curl example in section 3 here: https://developer.uber.com/docs/authentication
The authorization and authentication documentation doesn't mention anything about JSON, therefore application/x-www-form-urlencoded media type is to be used to send the HTTP POST request to the /oauth/v2/token API endpoint
I am using the PayPal REST API for the first time and trying to get an authentication token but keep getting an "Invalid credentials error".
I am following Step 2 in the documentation found here:
https://developer.paypal.com/webapps/developer/docs/integration/direct/make-your-first-call/
I am using the Chrome extension "Advanced rest client"
Here are the values entered in the rest client:
Header:
content-type:application/x-www-form-urlencoded
Accept:application/json
Form data
grant_type:client_credentials
clientId:ASF6RRBP0uTq7FnC90tpFx7vfA-Pliw8uQDjv5RZ10Y_NVspuc88pUPLN6yM
secret: EAdx7BDKzWczDomYG2QDHu8jhaAXj4xDZLHadvL5aRfesjwo5c81zbSpRxuE
When I send the request I get the following error:
{
error: "invalid_client"
error_description: "Invalid client credentials"
}
Can anyone help me to figure what I am doing wrong here?
Form data should only contain
grant_type=client_credentials
and then add header
Authorization: Basic put base64of(clientid:secret)here
don't pass client id and secret in form data.