how to make a get request to data from response_url of slack api - axios

I am using the slack api in a typescript application, where when I initially send a payload through a slack / command, this payload has a response_url. I am able to post data to this response_url with axios, but I have trouble making a get request to this url to access the data I have previously posted. I have tried axios.get(response_url) and await axios.get(response_url) but I have gotten invoke error with status code 500 and a result of Promise {<pending>} - would anyone know the correct way to use the get call?

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?

Data Factory Web task - getting full output from a post

I am passing json data to a post request via a web task.
The body contains a number of records that are to be saved by the api.
The body returned contains a status per record sent, but within the webtask i cannot see the over all status of the post request.
In postman, the overall status shows up like below:
This status and response code (429 in this case) is not visible in the output of the webtask.
Is anyone aware if i can view this in the webtask, as its clearly visible via postman.
Thanks,
I don't believe there's any way to get this; some time ago the MS response was to create a fn app to capture it and call that from adf :)
However you can at least distinguish 2xx from 4xx by using the On Success and On Failure dependencies in the pipeline

Ajax call to Zomato API is not working

I am trying to access zomato api.
URL: https://developers.zomato.com/api/v2.1/categories
Headers: 'X-Zomato-API-Key':'myapikeyhere-763demoapi434'
If I use chrome's postman extension or curl then I can access the url & getting 200 status code.
But if I run it through my angular2 app or simple ajax, it is giving error at preflight OPTIONS request, error code is 501. I have tried otherways too, error is same. Need help
Zomato API's can only be accessed from server to server calls, the error message you have reported is a security policy implemented by Chrome to prevent cross site request forgery on the client side.
A way you can get around this is to write a handler on your server end to make handler which the ajax call will use, this handler in-turn makes a request to the Zomato's server to retrieve the data required.

How to write a GET request in API Manager?

I am trying to write the GET request for the search API. I am writing it like this http://localhost:8280/solr/1.0/search?searchText=abc, but I am getting a 404. If I'll write it as http://localhost:8280/solr/1.0/, I'm able to get the JSON response data.
I wrote it is as /* and getting the response using the URL http://localhost:8280/solr/1.0/.
If I am writing it as /search* I'm not getting the 404 (http://localhost:8280/solr/1.0/search?searchText=abc).
Where am I getting wrong?
enable wirelogs and check what kind of request is sent from AM to Backend. You might be able to find out the reason for this. refer http://mytecheye.blogspot.com/2013/09/wso2-esb-all-about-wire-logs.html to enable and analyze the logs

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