Unauthorized OAuth Token: signature_invalid when adding anything to the request body on POST - api

When doing any filters or any other option allowed in the request body per documents like this: https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0400_quickbooks_online/in... (the quickbooks online API document) I always get the error "Unauthorized OAuth Token: signature_invalid" in my own application as well as the API tool located here: https://developer.intuit.com/apiexplorer
Example of what I put in request body:
PageNum=1&ResultsPerPage=20
or simply ResultsPerPage=20
I am not sure why this would also happen in the API Explorer even per instruction but it does. Without the ability to move the page marker and show more results as well as being able to filter, I will simply not be able to use the API as you can see.
Any ideas?

It could be a bug in ApiExplorer. I tried with RestClient plugin of Mozilla browser. It worked fine.
Method - post
Content-Type - application/x-www-form-urlencoded
Paging filter - PageNum=1&ResultsPerPage=1
Snapshot
Thanks

Related

Need to test Speakatoo API on Postman

I am looking to test my Speakatoo API credentials for my Text to Speech setup in my CRM. I have referred the API documentation however, I am not getting the JSON response as expected.
Can someone guide me how can I first setup the test on postman and then implement for my PHP application.
I tried to include the raw request as below:
{
"username":"cyro***#gmail.com",
"password":"*********",
"tts_title":"testing_API",
"ssml_mode":"0",
"tts_engine":"neural",
"tts_format":"3gp",
"tts_text":"Text for synthesize",
"tts_resource_ids":"TRDu7S1e63c6f288f85180a9130c4e5e10f39dc7fsmJ1XYfxH",
"synthesize_type":"save"
}
I guess, you should take the raw JSON body and test with your credentials. Don't forget to pass header Authorization else it won't work.
You may also implement in your application and it should work. Additionally, you can always contact their support team.

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. :)

Postman request - how to get data from endpoint based on API documentation

I want to retrieve data from a data warehouse that has a web-based API, I need to use an API key for authentication and use the GET / Customers command to retrieve the list of customers data, but when I am using that same thing in postman, it's returning the same documentation page of the data warehouse?
I am new to this any help will be really appreciated.
The URL doesn't look valid:
You need a base URL, endpoint, http method, authentication scheme, and credential or a token etc.
I don't know details about your system and API, so let's see an example:
base url is https://stackoverflow.com; your current base url is localhost:4444, is your server running on your machine? If so, it might be correct, but I assumer you're talking about a server running somewhere else, not on your computer
endpoint (path parameter) is /questions/69883697, in your case /customers
http method is GET and you find it here in Postman; it also means it will not go into query parameters where you put it:
authentication scheme - your docs mentions an api key that goes into a header called Authorization, so you have to set it in Headers, not as a query parameter:
Read carefully what's on your screen, Postman uses the same language as your API documentation, so if your doc speaks about headers, you need to go into Headers tab in Postman.

Twitter API 1.1 collections show 403/220

I can't access this particular Twitter API endpoint:
https://api.twitter.com/1.1/collections/show.json?id=576828964162965504
(with any ID I tried). The request returns an error with the message "Your credentials do not allow access to this resource" and code "220".
The App-only authentication Bearer Token I'm using for the request is exactly the same as for my requests to /search/tweets.json, /statuses/user_timeline/show.json, /statuses/show.json and /users/show.json, all of which work just fine. Also the collection is public, so App-only authentication should suffice, I'm thinking.
I'm somehow sure that I'm missing something here, but can't find it anywhere in the official API docs, nor on StackOverflow, nor on Google.
According to the Twitter API documentation, collections/show requires a user context - so app-only authentication will not work in this case.
Additionally, collection IDs are usually in the form "custom-756140390927872000" or similar. You can get the list of collection IDs from a user by hitting the collections/list?screen_name=handle query.

Update issue fields in JIRA

Hi I am using postman client for Chrome to run my rest api calls. I am trying to update issue in JIRA via rest API. I have referred to JIRA API also for updating an issue.
I am using PUT method to update an issue fields. Here is the syntax.
PUT /rest/api/2/issue/{issueIdOrKey}
I am trying to update summary field like this.
{"update":{"summary":[{"set":"Bug in business logic"}]}}
But it is giving me the 400 bad request error.
and in the body its showing message "No content to map to Object due to end of input".
Please find the attached screenshot for more reference. Thanks in Advance.Jira Update issue
In postman rest API client, add the json object to Body as in the below picture.
I added authorization as Basic Authorization and provided JIRA credentials.
Note that the body should be raw and type should be JSON(application/json) instead of Text(default).
Response for this PUT request is 204 when update is successful.
Here is REST API Documentation for additional options.