AWS APIGateway "Missing Authentication Token" - amazon-s3

I have been working on AWS APIGateway and I had created one by following one of the youtube videos (https://www.youtube.com/watch?v=0UxiV5sUlcA). I tested the URL using postman and https://reqbin.com/ and it seems to be working (GET).
What I did then is requested EMFIT to send test data to the URL I created, he got back to me and was told that there is a" "message": "Missing Authentication Token" '.
I feel like the GET method is not enough for a third party to send test data to the URL I provided him. (missingauthenticationpicture here are the methods and resources I created) When I tested in postman with POST method (if that is the correct method in order for emfit to send test data), it shows the error above.
Am I missing a method in order for the third party to send test data? Any guidance is greatly appreciated. I am fairly novice and I am learning via feedbacks and some videos.

Related

Ebay API: Connection between "Developer Account" and "Ebay Account"

A am just beginning to familiarize myself with the eBay RESTFUL API, forgive me this basic question, but I found no answer yet.
I have an eBay account since many years ago. I registered a developer account (same eMail address) recently, and I got the Tokens for Sandbox and Production. I have successfully used public APIs like list items, search items, and such, to verify the tokens, by querying some items in eBay.
How do I preceed from here to access data specific to my eBay account, like, for instance, the list of purchases and sales? Somehow I need to connect my app to my live eBay account, I guess, and give my app permissions to read data, but I could not find any matching setting in my eBay account settings nor in the API calls.
Please guide me through the next step: how do I give my app the required permissions, and how do I build a simple read-only query to query, for instance, the items I have purchased.
I think this question does not depend on any programming language, feel free to use any programming language you like.
Many Thanx!
Ok so if we are talking only about Authorization token and calling seller api like orders (in ebay it's called fullfilments i believe).
We need to start with creating User Token.
You can create one here:
Then you need to add ebay redirect URL:
I don't know much about Auth'n'Auth so I will talk only about OAuth
After adding new redirect URL you should add url address for authorization success and failure.
You will be redirected there after authorization.
Now we can test if generation of token works.
For this example i did set my redirect url like that:
We need to click "Test Sign-in" (set radio button to OAuth before)
You should be redirected to website:
You need to sign in with account which have access to sandbox.ebay.com or ebay.com (depends if you are on sandbox or production environment)
After logging in I don't remember if there will be another window with confirmation of App scopes to confirm (I already done it before).
But if that is the case just click confirm button.
Now you should be redirected to https://localhost.com which we did set up as our success redirect url
Url should look like that
https://localhost.com/?code=v%5E1.1%0VeMTI%3D%3D&expires_in=299
That code parameter is much longer btw. And you can see that it's url encoded so you need to decode it before using
And now you are almost at home :D
You have 300 seconds to call a POST request to authorize with that code parameter.
POST https://api.sandbox.ebay.com/identity/v1/oauth2/token
Header required
Remember first screen shot?
You need to go there and get your App ID, Cert ID then concatenate it with ":" then encode it to Base64 and add before that value "Basic " keyword.
In pseudo code it should looks like that:
Authorization:Basic Base64.encode(AppID + ":" + CertID)
Body required
format of Body needs to be "x-www-form-urlencoded" (key:value format basically)
here you need
grant_type:authorization_code
code:{code}
redirect_uri:{redirect_name}
{code} - is value from success authorization url
{redirect_name} - you can find it on screen below marked with red circle
If you did everything right you should get response from ebay
{
"access_token": "v^1.1#i^1#r^0VbbxW1wjv4HZGAAA",
"expires_in": 7200,
"refresh_token": "v^1.1#i^1#f^0#r^FDQ=",
"refresh_token_expires_in": 47304000,
"token_type": "User Access Token"
}
You should save that data, access_token is used for accessing data, refresh_token is used to refresh access_token.
Example request with authToken
GET https://api.sandbox.ebay.com/sell/fulfillment/v1/order?filter=creationdate:[2022-03-31T08:25:43.511Z..]
You need Authroization header:
Authorization:Bearer v^1.1#i^1#r^0VbbxW1wjv4HZGAAA
That's it I guess. To implement that into your app you need to be able to generate the first url which you are redirected to after clicking "Test Sign-in" and that's basically it.
Btw you refresh token like that
POST https://api.sandbox.ebay.com/identity/v1/oauth2/token
Body x-www-form-urlencoded
grant_type:refresh_token
refresh_token:v^1.1#i^1#f^0#r^FDQ=
Header
Authorization:Basic Base64.encode(AppID + ":" + CertID)
I hope that will help someone. :)

Google Cloud AutoML API REST call

I'm trying to send a simple request, via Postman, to the Google Cloud AutoML API, and I've been reading the documentation here: https://cloud.google.com/vision/automl/docs/reference/rest/v1beta1/projects.locations.datasets/get
On the page, it says the REST endpoint should be like so:
GET https://automl.googleapis.com/v1beta1/{name}
where name is the "resource name of the dataset to retrieve".
What exactly is the resource name?
I have a dataset in my Google Cloud AutoML, and I'm putting the name of the dataset in place of the {name} part but I keep getting "404 error".
I can't seem to find examples online of actually sending REST api calls to Google AutoML. Any help is greatly appreciated. Thanks!
the doc is not really clear here, the endpoint is not correct, I advise you to have a look at this.
The correct endpoint is :
https://automl.googleapis.com/v1beta1/projects/{YOUR-PROJECT-ID}/locations/us-central1/datasets
You'll need OAuth2 authentification, which is explained here .
Once you have an access token, you should set the header "Authorization" of your request to "Bearer {access-token}".

Trello API: Getting invalid token on all calls

I have a weird situation, which I hope you can help with.
I am trying to setup a simple Trello application. What I do are the following:
I go to https://trello.com/app-key and get my KEY
I go to https://trello.com/1/authorize?expiration=never&name=SinglePurposeToken&key=MYKEY for a permanent server to server key
I authorize
I get a token
Now I'm ready, but then when I want to make a call such as:
https://api.trello.com/1/boards/BOARDID/actions/?limit=2&key=MYKEY&token=MYTOKEN
I get "invalid token".
Reason I post here on StackOverflow, and not Trello support, is because I assume there is something basic I am doing wrong!
I was wrong about step 2).
I should use this link instead:
https://trello.com/1/authorize?expiration=never&scope=read,write&response_type=token&name=APPNAME&key=KEY
This gave the working token. All is well!

Where is GCM documentation for 'InvalidTokenVersion' error?

I am using the Google Cloud Messaging services described at https://developers.google.com/instance-id/reference/server but I am getting a HTTP response status of 400 and this response text:
{"error":"InvalidTokenVersion"}
At the time I write this, that exact error code has zero results on Google! Has anyone else encountered it? I could understand "InvalidToken" but it is the "Version" bit which is confusing me.
I'd like to see a nice list of all the possible error codes for the https://iid.googleapis.com/iid/info/ and https://iid.googleapis.com/iid/v1/*/rel/topics/* services, if you know where that is?!
All the GCM pages say at present is...
HTTP status 400 (Bad request) - request parameters are missing or invalid. Check error messages for detailed information.
Background information:
I am using a registration token from an Android device which still shows a log of successful notifications in the GCM Diagnostics (part of Google Play Developer Console). So surely the token cannot be wrong?
If I try a token value of "bum" I get error "InvalidToken" instead.
However, trying to send a new notification with https://gcm-http.googleapis.com/gcm/send results in the "InvalidRegistration" error, so I guess something has gone screwy.
I'd like to claim that I've changed nothing recently, but something to do with SSL on the server might have expired I suppose.
The token you are providing is regId not instanceId.token. Follow the documentation:
https://developers.google.com/cloud-messaging/android/client.
see examples here.
https://github.com/googlesamples/google-services/tree/master/android/gcm/app/src/main/java/gcm/play/android/samples/com/gcmquickstart

Google Simple API key stopped working

I'm using Python/Twisted to do asynchronous HTTP calls to the Google+ API. Our client app passes over the user's access_token and we do an API call to...
https://www.googleapis.com/plus/v1/people/me/?%s&key=%s&
... where %s and %s are being filled with a valid access_token and (supposedly) valid Simple API Key, respectively.
Everything was working beautifully yesterday. Today I continued to work on the unit tests for this when the API suddenly started returning:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "keyInvalid",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}
usageLimits, keyInvalid... Okay, I get it. I've seemingly hit the usage limits and they have invalidated API keys coming from this account. Except, I haven't...
The "Courtesy Limit" is supposed to be "10,000 requests/day", yet I've only made a couple hundred calls (according to Google's own usage graphs), and I am still seeing "0% used" on the quotas tab.
I would have brought this to Google directly, but they seem to have dropped their Developers Google Group in favor of a Google+ discussion that doesn't actually receive any responses.
Any help or guidance is extremely appreciated. Thanks!
The answer was quite simple! You can't send both the access_token and the key in the same API call. If you use the access_token you're authenticating the API call as the user, if you use your projects Simple API Key you're authenticating as yourself. If you use both, the call fails.
Just so we are clear, you are using your key from your Google API Console page? On there you should see a tab for "API Access" near the top left hand corner of the page. Make sure that the API Key you are using is your Key for browser apps (with referers) Key, otherwise it won't work.
At any rate, an API Call for me looks like this:
https://www.googleapis.com/plus/v1/people/114789529333378876576?key=ENTER_YOUR_KEY_HERE
You should be able to make at least one API Call per day without a valid Key.
This took me quite a long time to figure out, so hope to save some time to someone else :)
Take a look at thi spost, by google staff (in 2012..) https://groups.google.com/forum/#!topic/google-ajax-search-api/HuKhXfsoMQc
Sorry for the delayed response. This error (which we're working on improving the descriptiveness of) also occurs when you have a
restriction on your key (e.g. locked to a specific referer or IP
address). Please confirm that if you've set such a restriction in the
APIs Console, that the referer or IP address that you're making the
requests from. Pay special attention to any wildcards used on the
referer - for instance, if you use *.abc.com, it won't work if your
request comes from "yoururl".
also would have been great if google team fixed this issue! :)
In my case - I just had to wait few minutes because it was short time after updating my API KEY. Whenever you create a new key or update it on YT developer console. YT has up to 15 mins to make all the changes on their side
In my case I had a parameter named Key, so it thought that was an actual key, just renamed the parameter.