I am trying to send Notifications and Data from Postman, To FCM, to my App. However i run into this 401 Error about me missing my authentication key. I have no clue what i have done wrong, i have correctly put in my Authentication key so i am very confused as to what is going on. Can someone please help.
I Followed this Tutorial
It was a rather silly mistake. Simply i needed to put my values in Header, not Params
Related
I used postman to send post request to the backend application. During this process i was encountered with this validation error : path email is required.
Resolution: In postman, I noticed that I was specifing the values in Params tab instead of Body.
I have spent some considerable amount of time in resolving this small issue. So i thought this post would be helpful for others and possibly would save some time.
Hope this post would be helpful for some.
I have added headers and token but still having insufficient_scope error by posting json through postman
You must share the details of request to get help. But let me also try to help you out blindly.
I had face the same issue in past and make it possible to resolve the issue by some simple attempts.
Please make sure that your token is correct, its not expired, and if your token is well authorized to make request and get access of the demanding resources from the calling API.
Also make sure that if you have need to add bearer in the start of your token.
Hope it can solve your related issue. Thank You!
Also, check your request method. (I just spent a good 30 minutes trying to figure out why I was failing.) If you have only the listings_r scope, then you can only GET. You must have listings_w to POST. (My problem was copy/pasting several lines of cURL code, and I assume someone else reading this may have done the same.)
We have an API that we are querying through React Native.
GET, POST request work flawlessly either in our app or in Postman.
DELETE doesn't work on the App, but the same request works with Postman.
What is even weirder is that :
If we delete the resource either with Django or Postman, making the exact same request from our app on the phone will give us a 404 response, telling us that indeed, it was deleted.
Which means that the call from our app is supposed to work since we get an answer from the API!
So, basically, the DELETE doesn't work from the app but if we delete the resource from elsewhere, it acts as if it works for real.
We tested it from two different phones, just in case...
And we are using Expo.
Example of our DELETE request :
https://apiurl/reservations/id_num {"method":"DELETE","headers":{"Accept":"application/json","Content-Type":"application/json","X-App-Token":"blablatoken","Authorization":"JWT blablasuperlongtoken"}}
UPDATE:
The question asked by MattyK14 was good, we get a 200 response which is supposed to be our GET response.
We investigated on this path but can't seem to find anything.
We are rebuilding the API using Axios as we can't find a thing and we will check.
FOUND THE ERROR!
We needed to add a trailing slash at the end of the API URL.
Django automatically transforms your DELETE request into a GET request if it doesn't get a trailing slash.
Thank you for your comments Matty and Arman.
I try to fetch all product data list in json from WooCommerce API and type address bar http://www.batata.in/wc-api/v3/orders. But it give an error:
{"errors"[{"code":"woocommerce_api_authentication_error","message":"oauth_consumer_key parameter is missing"}]}
I tried all things but issue is not fixed. Rest API is on.
If anybody know any other way to find product list in json format from WooCommerce WordPress plugins, then please tell me.
I have faced the same problem. After some research, I have solved this issue. Kindly check that your site secure or not [http or https]. I missed the "s" for http.
Please note that you need to provide consumer key, nonce, signature with your rest api call. Following is the format which worked for me.
http://SomeURL.com/wc-api/v2/orders?oauth_consumer_key=########&oauth_timestamp=######&oauth_nonce=#############&oauth_signature_method=HMAC-SHA256&oauth_signature=##########################
For generating nonce and signature I recommend you use some wrapper available for your platform. I used php so got a nice library here.
https://github.com/woocommerce/wc-api-php
Important:- Even after following all above steps correct I got the same issue you faced. It kept giving me error "oauth_consumer_key parameter is missing" which actually was misleading. The issue I figured out was the basic http auth. I had http authentication in place so the curl request I used to fire was returning 401 unauthorized. If you are using php you will understand following line.
curl_setopt($this->ch, CURLOPT_USERPWD, "USERNAME:PASSWORD");
And it worked. So point here is you can try this or play around with your curl/socket or any client you are building and don't focus on the error message as it is misleading most of the time.
Sandipa Mukherjee's answer is right.
For http:// additional oauth parameters are required, because it's not safe.
My suggestion is to use the https:// server for wordpress.
Please refer to https://scriptstown.com/how-to-setup-cloudflare-ssl-and-configure-origin-certificate-for-apache/
We have an assignment to check the compatibility of Quick connect project for Foursquare against the REST/JSON 1.1.
When I am testing the process, while invoking Rest API for query Check-in, the process is throwing an error – “OAuth token invalid or revoked”. Can you kindly help to fix this issue.
Access_token for this was generated by registering a sample app with Foursuare.com, having www.google.com as welcome page and redirect URL. Please let me know if this is causing the issue.
Also, let me know is there is any standard method to generate the access_token for this.
Thanks in advance.
Regards,
Shree.
It sounds like you're not following Foursquare's instructions on connecting properly, or need to reconnect to get a new access_token. Keep in mind that the access_token isn't the code that comes back in the redirect, the code needs to be used to exchange for the access_token.