HTTP request requiring cookie - json

I am attempting to replicate a HTTP Request to a Google Analytics endpoint -
https://analytics.google.com/analytics/app/data/admin/annotations?dataset=XXXXXX&hl=en_US&state=app.admin.annotation.table
The endpoint itself returns a JSON string that i want to use and in this case it is returning the Annotations used in GA itself.
I've been able to capture the HTTP request using Postman and i then used Fiddler to work out why postman wasnt working. It ended up being the cookie needing to be set.
As i want to automate the extraction of this JSON string, i can't provide a cookie each time. Is there any way around this?

Related

How to use azure api management to do custom access token check and enrich data in request

All the incoming request to api management will have a token in a header, before backend service is hit token has to be verified. To verify token a GET tokenVallidationApi is to be hit and the response will tell us whether the token is valid or not. If the response exists for token validation , we have to take out few entries from response and enrich the body/header to hit the backend api. I am very new to api management tool and just figuring out how can we achieve this with azure api management?
This is possible. You would have to implement your policies like something below
1. Validate Token
For this, you would first call the validation endpoint using send-request. You could also implement caching using value caching policies for multiple requests.
The doc also highlights how you can extract value from the response body.
2. Transform Body & Headers
For headers, you would use the set-header policy and for the body, you would use the set-body policy.

Trestle Request unsuccessful. Incapsula incident WebApi error

I'm working with Trestle which is real estate MLS service to get property data etc. I have followed their WebApi docs but I'm getting this error whenever I hit their api it looks like their server thinks that request is from some BOT. Even they recommend using Postman to test api:
Its been 3 days and still cant find any fix. Any help?
You do not seem to be following this documentation correctly.
https://docs-trestle.corelogic.com/GettingStarted/WebAPI
At the moment you are entering the token URL (https://api-prod.corelogic.com/trestle/oidc/connect/token) in the main Postman request URL field. The documentation states that you should use the Get New Access Token button on the Authorization tab of a request. You are entering the token URL in the main Postman request URL field.
This is a default flow for oAuth 2.0 requests in Postman.
https://learning.postman.com/docs/postman/sending-api-requests/authorization/#oauth-20
Example:
This could be your request to retrieve data:
https://api-prod.corelogic.com/trestle/odata/$metadata
On the Authorization tab you should select oAuth 2.0; select Get New Access Token and you will see a view which gives you the functionality you are looking for.
When successful, you will get a pop-up which you need to accept in order to use the API.

Manually triggering get request gives different response then when made through whole application

There is a website and I want to access their backend api. I found a request which gives me json response, but when I change some parameters in the url, response is not changing, it's the same. I am not sure about the other parameters, but this one parameter that I want to use should change the response, but it's not.
Furthermore, when I monitor network tab in developer tools in chrome, and I send the request for the whole website, request that I want to use is listed and the response has the data I want, but when I copy that URL and send the request myself (isolated from the website) I am getting different response.
I've tried with two different locations over VPN and clearing chrome cache and it didn't work. Is there a way for this request to give the same response when caught while whole website is loading and when triggered manually?
I solved this problem by setting the appropriate request header. There was a request header that changed the api response.

Angular 5 - Receive POST requests

Scenario: My angular page should be receiving a POST request with JSON data from SpringBoot API.
Consider this as a work example: When client clicks on login on an angular webpage, the login info would be sent through JSON to SpringBoot where it will validate the user,if it returns true, the same JSON would then be forwarded back to webpage as POST, where it will be captured and then worked on(displayed for example).
Now, as per this link, it is said that POST requests cannot be received on Angular but need Express for the same. Is it true? or is there any other way to receive POST requests from API using Angular? I'm googling on this from many days and haven't found anything relevant that confirms this and needed a closure.
Angular is a library for providing a user interface in a browser (which is a type of HTTP client).
To listen for an HTTP request you need an HTTP server (such as Apache HTTPD, Lighttpd, NGINX, something built with Node.js+Express, etc, etc, etc).
is there any other way to receive POST requests from API using Angular?
No
should be receiving a POST request with JSON data from SpringBoot API.
Spring is a Java framework for running a webservice.
Typically it receives HTTP requests and makes HTTP responses.
While you could make HTTP requests from it (i.e. when a client makes an HTTP request to a Spring API, the Spring API then makes an HTTP request to another web service and uses the data in the response to construct its own response to the original request)…
… it sounds like you have the wrong end of the stick and really need to make an HTTP POST request from Angular to Spring and then read the HTTP response in Angular.
i.e. Ajax.

How to get mosync app to use RESTful APi and json payload

I have written a mosync application that interacts with a REST we service. I am using the AMDownload package. Wat is the right way to send the json payload required by the REST API?
The HTTP 400 Bad Request perhaps happens because the MoSync Android runtime messes up the URL, causing the server to return this error. Alternatively, perhaps the MoSync Android runtime considers the URL to be wrong, and sends back the HTTP 400 Bad Request.
Is it possible for you to test on an Android device? To see if the result is the same.
Also, is it possible to find the exact URL/data sent to the server? Perhaps using some network monitor software. If you have access to the server, can you see the request it receives? If you would enter the same request in a client like the Firefox RESTClient, do you get the same response?