i want to have the following json data in request
{"altitude":"444.0","heading":"230.0","timestamplocal":"2018-12-07 18:37:24","fuelLevel":"359.04"
How can i put the data in request of proxy?
The above json payload in request.I want to filter out only 2 keys in the response.Can u explain the flow also?What will be my target backend for the above project?
I want to create a request to input into api proxy.
the keys i want are vehicleregnumber,latitude,longitude,gpsspeed.
Do you have the swagger or sample request payload?
If you are free to decide the request payload structure, you can have a flat structure with the attributes mentioned by you.
{"altitude":"444.0","heading":"230.0","timestamplocal":"2018-12-07 18:37:24","fuelLevel":"359.04","location":"Srinagar - Kanyakumari Hwy, Naduhalli, Tamil Nadu 636701, India","vehicleregnumber":"NL01AA3961",
Please guide me how can i set up the request?
Answer by Nagashree B
·
Dec 12, 2018 at 05:23 AM
@himadri bhattacharjee, can you explain a little bit more. Is this payload coming in the request to the API proxy or do you want to have this as a static payload sent to the Target? Which keys do you want to filter and what is the response json format you are expecting?
Wherever you would be routing your request that would be your target backend. Or are you using the API proxy just to manipulate the request json and send out the response?
You can use the extract variables policy with the jsonpath to filter out the required json elements
Answer by Dino-at-Google
·
Dec 14, 2018 at 12:26 AM
Your request is not clear.
What do you mean "I want to HAVE THE FOLLOWING DATA"?
Are you asking about how to structure your client code to make a request containing that data?
"Putting the data in the request" is ... dependent upon the client framework you use. If you use curl, then you can "PUT" the data in the request by using the -d switch.
curl -i https://myendpoint/mybasepath -H content-type:application/json \ -d '{"altitude":"444.0","heading":"230.0","timestamplocal":"2018-12-07 18:37:24","fuelLevel":"359.04"}'
If I do this, then the thing (maybe a proxy) listening at https://myendpoint/mybasepath will receive that data.
If this is NOT what you want to do, then you'll need to be much more descriptive and specific about what you are asking. Give examples. Elaborate.
Api proxy new resource's description and input list 1 Answer
Can I filter certain resource paths while defining product ? 1 Answer
How to support target pre and post flow in shared-flow in apigee ? 1 Answer
checking the presence of a string in an array of strings in conditional flow. 1 Answer
Management API Update API Product 2 Answers