Azure logic app API http response with excel file download using Postman - api

Created azure logic app HTTP request it gives response for normal JSON schema However, I want to attach SharePoint excel sheet when I trigger the request from Postman.
1.How to used content type or schema to download the attached file. when postman request sent.
2.is that possible to download when you hit API through logic app
3.Generated HTTP POST URL is working

For your requirement, I test it in my side. It seems we do not need to set any value for "Content-Type" in headers of response. Please refer to my logic app below:
Then when you request the logic app url in postman, please choose "Send and Download" instead of "Send".
After that, you can download the file when request the url in postman.

Related

Amazon Connect API didn't response correctly in Postman

I am trying to test Amazon Connect Rest API in Postman. The API name is GetMetricData. In Postman, I have provided all the required information that is mentioned in the documentation. I have provided the JSON body, URL, and Header, although API is responding 200 OK status but in the response, it is throwing the following errors that you can see in the following screenshots.
I have set AWS signature with proper credentials such as access key and secret key
In the second error it is suggesting me to enable Javascript in the browser which is already enabled in my browser.
Can someone please help me here, I don't know where I am doing wrong. As I am totally new in this field, any help would be appreciated.
Thanks
You are submitting the POST request to the UI distribution endpoint for your Amazon Connect instance, not an API endpoint. You are getting HTML and javascript response body back from the UI distribution because this is meant to be consumed by a browser.
Your API request should be sent to a URL that looks like https://connect.us-west-2.amazonaws.com/metrics/historical/<instanceId>. In this example, my Amazon Connect instance is located in the us-west-2 region so I'm using the connect.us-west-2.amazonaws.com endpoint. You can find all available Amazon Connect API endpoints in the documentation here

Jmeter showing response code as 300 in response

I am working in a desktop application which contains API as well.
So when I try to hit the API using Jmeter with the local server name as localhost. I am getting the response as below
Response code:300
Response message:MULTIPLE CHOICES
Response data:
{"succeed": false, "error_message": "No data JSON received!"}
Even I tried with the Content-Type as application/json and multipart/form-data, but not worked.
Note: When I try to hit the same API using Postman, I got the 200 status.
If you're able to successfully execute the request using Postman you should be able to do this using JMeter as well. We cannot state what's wrong without seeing your Postman and JMeter configurations, just make sure that everything is the same:
request URL
request bosy
request headers
etc.
If you will send the same request - you will get the same response.
Be aware that you can just record the request from Postman using JMeter
Start JMeter's HTTP(S) Test Script Recorder
If you're using HTTPS protocol - import JMeter's certificate into Postman
Configure Postman to use JMeter as the proxy
Run your request in Postman
JMeter will capture the request and generate relevant HTTP Request sampler and HTTP Header Manager
More information: How to Convert Your Postman API Tests to JMeter for Scaling

JMeter: Record n play, also gives API access

I have recorded a login flow of an application and found some URIs like below:
/api/oauth2/initiate GET
/oauth2/authorize GET
/api/v1/oauth2/authorize GET
/api/v1/oauth2/authenticate POST
{"username":"${Username}","password":"${Password}","client_id":"${client_Id}","response_type":"code","redirect_uri":"${scheme}://${host}/api/oauth2/callback","server_id":"${server_Id}"}
When I am hitting above in sequence via JMeter I am getting 200 response. Just like JMeter I tried recording in Postman and it worked same, but instead of JSON it gave response in XML format.
It doesn't generate a access_token, it works via session cookies.
My question is - Do I really have API access or it is just browser record n play? If Yes, Does this mean I can get access to any API, if I am a registered user of that application? For ex: Facebook, YouTube or any startup website.
JMeter works on the protocol level. This means that whatever request you are generating. Say a simple browser request or an API call, you can do that easily.
Now the thing is replicating requests. You don't need to record the requests necessarily using the browser. You need to analyze the few things that are required. Say Postman is generating a request. You specify the things you want to send and you use the API Token there. The same things can be specified there as well. It all depends on how you are understanding the concept of request generation.
You simply need to replicate the samplers and the parameters. And the request headers in postman can be replicated here in the same way.
For each HTTP Request Sampler make sure you add a corresponding child HTTP Header Manager config element.
Headers basically tell the server that what client we are using and in what form data is being sent and then server responds accordingly with the information.
What you're recorded is OAuth2 flow and you won't be able to replay it without correlating the dynamic values.
You can have access to Google API or Facebook Graph API given you have proper access_token but I don't think you should be testing them directly, you should focus on solely your application.

Why api response body is not showing in postman app generated documentation?

I am testing apis usng postman continuously and then generating api documentation using postman app.
But problem is that documentation is not displaying api response which i am receiving in postman console. Here is the response which i am receiving for most of my apis
How can i get response body also in my api documentation?
If the request has been saved to a collection, You can use the Save as example feature, found to the top right of the response body. This will open the example builder and once saved, this response body will be shown against the request on your API documentation.
More details of how that works can be found here:
https://learning.getpostman.com/docs/postman/collections/examples/#how-your-examples-appear-in-postman-documentation

REST request doesn't work outside of Explorer

I'm using Restler's API Explorer (a fork of Swagger UI) and when I test a service call there it works fine but when I cut and paste the same URL into Chrome's Advanced REST Client I get a "403 Forbidden" error. How can that be? Is there some sort of required header parameter that needs to be passed with the request?
Here are the screen shots:
You need to get the content type right. Make sure you are sending the data as JSON (application/json)
You need to add a header
Content-Type application/json