How to call REST API related to Azure Search through postman? - rest

I am trying to call REST API related to Azure Search through postman.
Here is the API link: (Check Step 1: Create a data source)
https://learn.microsoft.com/en-us/azure/search/search-howto-indexing-azure-blob-storage
Have sent parameter api-key: [admin key] in form-data and other through jSON object.
I am getting 403 error.
Whats the correct way to get required output?
Update :
Changed position of api-key. Still getting the error as :
Is there any additional setting for postman to work with Azure's REST APIs?

Please make sure that you pass api-key in Headers instead of form-data and also all the headers should be selected. Once you do that, things should work just fine.

Related

Binance BSC logs API request data failed

I am submitting a request for data from the Binanance API as follows:
https://api.bscscan.com/api
?module=logs
&action=getLogs
&fromblock=24726622
&toBlock=24726632
&address=0x94084b7a8d80b2c3cc0dccd87cb6ae3cc67d364d
&topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
&apikey=JRYDR6FBWRKY5C8NMZJKFB8GEP1QHFQJQT
However, I can't get any data from this URL. I have double-checked, and I know that the parameters are correct.
Here is an example of using Binanace's API, which works well:
https://api.bscscan.com/api
?module=logs
&action=getLogs
&fromBlock=4993830
&toBlock=4993832
&address=0xe561479bebee0e606c19bb1973fc4761613e3c42
&topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
&apikey=YourApiKeyToken
Why is that working but mine not working?
I would highly suggest using Postman, which you can use to quickly test requests. I ran your request, with api-key, through Postman and was able to get a 200 response with data. See this screenshot.
Please note I blanked out the api key value. I suggest you do the same in your post unless its fake.
I had to remove the line breaks in the code you pasted. Could this possibly be the issue?

How to call Rest API from Powershell with multipart/form-data

I do not have any background on Web services or Powershell.
Due to restrictions of our ETL tool not handling multipart/form-data, I need to call the REST API (Post) from PowerShell. I am using the Invoke-RestMethod cmdlet.
API is a post method doing a bulk import on the target application. It has a header for Authorization with an access token. I have figured out the headers IDictionary object.
The call has a multipart/form-data request body.
In postman, I do the following:
For key type I choose file. In key field I put "file" and in value field I place the filename with the path.
How do I replicate this request body in PowerShell?
All links I searched so far seem to be similar to my requirement but I am not able to gather/understand enough to implement.
Your help is appreciated.

Magento REST API keeps returning "signature_invalid" error

I'm trying to use the Firefox Rest client extension to test out my Magento REST API. I followed this guide but I keep getting the "signature_invalid" error when making the final request to receive the access token.
Guide: http://devdocs.magento.com/guides/m1x/api/rest/testing_rest_resources.html
The URL I use for the final request is:
http://mymagento/oauth/token?oauth_callback=http://httpbin.org/get&oauth_token=99e48f7d46d3a2f8fef704865fe2f4e4&oauth_secret=eda948ee46250f335146f6f4c5f7d622&oauth_verifier=1d977f0b96f3ae07fff515c590ec6709
And these are the readers:
OAuth oauth_version="1.0", oauth_signature_method="HMAC-SHA1",
oauth_callback="http%3A%2F%2Fhttpbin.org%2Fget",
oauth_token="99e48f7d46d3a2f8fef704865fe2f4e4",
oauth_secret="eda948ee46250f335146f6f4c5f7d622",
oauth_verifier="1d977f0b96f3ae07fff515c590ec6709",
oauth_nonce="OmOzMMy2Z60m5sV", oauth_timestamp="1495611445",
oauth_consumer_key="abc77ce5a53e67333af04807dea1356b",
oauth_signature="tE6xzRXZIc4BPQ3Dxc80ddoitLg%3D"
The nonce, timestamp and signature are automaticly refreshed each request.
I'm using Magento CE 1.9.2.2.
I have also tried Postman, but that tool gives me a nonce_used error with every request, even though it's automaticly refreshed... Permissions are correctly set up as explained here: http://inchoo.net/magento/configure-magento-rest-and-oauth-settings/
Everything goes fine using the Rest client extension untill the final request where I want to receive the access token.
I found the solution... The local browser had cached the oauth responses...

Why am I getting request method GET not supported?

I am using PostMan as a REST client to test this API method Cisco ACL Analysis API. specifically POST /acl/trace or getAClTracksStd (first go to Policy Analysis)
Here is my PostMan HTTP test call
Does anyone who is familiar with PostMan understand why I am getting this "Request method 'GET' is not supported" error from the server? I am making a POST HTTP request, not GET.(Selected from Drop down menu) It make more sense for me to get a input invalid parameter error or something.
Just to show that the endpoint url works, heres a HTTP test request that works
(same link, host->host API -> GET /host/{startIndex}/{recordsToReturn}
There's two issues that I'm seeing with your REST call. First, the error you're seeing is because the call needs to be preceded by "https://". Second, remove the interface IDs parameter and values. You should get a response with data after making these changes.
Your json looks erronuous (comma after the destIp) - and the server probably always responds with a default confusing error message in this case. (Postman is very well tested and it sends POST).

What's the correct uri for QBO v3 API update operation?

I'm trying to use the QBO v3 API object update function described here. The API explorer shows a different uri.
I'm trying to update an account with Id 42. Both of the following URIs get me a 401:
As the documentation would suggest:
https://quickbooks.api.intuit.com/v3/company/0123456789/account?requestid=42
(the above at least gives me a json blob with the 401)
As the api explorer would suggest:
https://qb.sbfinance.intuit.com/v3/company/0123456789/account?operation=update
(here I don't even get the json, just a plain 401)
My request body is successful when I use the api explorer, so I don't believe that's the problem. I also don't believe authentication is the problem, because I can successfully create objects and also make queries with the same headers.
What might I be missing?
Don't put the Account object's ID into the URL. The [?requestid=] from the documentation you mentioned apparently refers to an id related to the request (not the object in question). The API Explorer's URI appears to simply mislead (although I could certainly be missing something here).
In your example, just use this:
https://quickbooks.api.intuit.com/v3/company/0123456789/account
Let the headers and request body do the rest.
Correct BASE URI: https://quickbooks.api.intuit.com/v3/company/
you can refer example request/response section of any entity doc.
Ref -https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/030_entity_services_reference/bill
To debug(401 authentication issue), you can use any standard RestClient.
In the following thread, I've explained how to use RestClinet plugin of Mozilla to test any QBO V3 endpoint.
InvalidTokenException: Unauthorized-401
You can download IPP's devkit and using that devkit you can call any endpoints easily.
https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits
Hope it will be useful.
Thanks