Find what parameters should I send for a POST request - json

I am trying to call a web service with a POST request, but I do not know the name of parameters that should be sent in the request. All I know is the address of the web service. Based on that, how can I find the parameters names?
Thank you for your advice,
Cheers.

For SOAP services you could get the interface from published WSDL. For HTTP based web services (REST), WADL was designed to describe the functionality, but it is not widely used, and it is not standarized by W3C.
Therefore, if you are not using SOAP, I suggest to look at documentation

Related

Handle form-data using Azure APIM policy

Disclaimer : I am very new to Azure API Management
Hi Friends,
I have the following requirement to be accomplished -
The user will upload an image from a mobile app as "form-data".
An API will be called through Azure APIM and the image will be stored in Blob.
The call should also invoke a backend API at the same time along with the image which does processing and gives the result back.
Could you please suggest how should I proceed on writing the APIM policy for this. I am aware of handling the image at the API side if it comes as part of JSON data. I am just looking for suggestions on the APIM part or more precisely about how to write the policy if the image is part of form-data.
Any help is appreciated.
Thanks and Regards,
Amit Anand
I am just looking for suggestions on the APIM part or more precisely about how to write the policy if the image is part of form-data.
I have reached out to the APIM team for this scenario and they've confirmed this isn't supported at this time. The recommendation is to use JSON payload and, parse & consume accordingly.
If you feel strongly about this, please consider submitting a feature request on Azure UserVoice for the APIM team to review for the product roadmap.
Refer to this issue.

Is there way to submit SOAP request to gRPC endpoints?

We have used gRPC-JSON trans-coder to submit JSON request to GRPC. Due to the different 3rd party services, Now I have to find a way to submit SOAP request to the GRPC. Please advise me.
You may want to post a question on https://github.com/envoyproxy/envoy to find out if Envoy supports SOAP at all. If not, probably nobody has looked at mapping SOAP requests to gRPC (with or without Envoy).

Using the POST method of a REST API for read operations

In a restful API, POST should be used to create, and GET should be used to read.
Sometimes, for security reasons, you can't pass sensitive variables in the URI. For example, if you have an /accounts API that requires you to pass "accountNumber". If your security team won't let you put that in the URI, then you have to use the POST method instead of the GET method to service the "read" operation, and you can then provide the account number in the request body.
That brings me to my question: If you've used up the POST method to service a read operation, how do you service the "create" operation of the same API?
"/accounts/create" wouldn't be advised because your APIs should be nouns, not verbs. It doesn't seem right to use up a different HTTP method like PUT. This issue has to come up a lot so I'm curious what people are doing to get around it?
If you're using POST for this, you are not building a RESTful service. The way I see this, you have 2 options:
Accept this, and build a more RPC-like system.
Change the id's in your application so that they are not a security risk. If knowing an id is a problem, consider using something else.

Using EWS SOAP requests in an Outlook web add-in

I need to use several EWS requests (e.g. GetUserConfiguration, UpdateUserConfiguration) that are not supported using Office.context.mailbox.makeEwsRequestAsync.
I cannot use the EWS Managed API in my own web service as a broker, and must use XML SOAP requests directly from the add-in's JavaScript (those methods are not available in the Graph or Mail APIs).
There are many examples (like this) showing how getUserIdentityTokenAsync can be used to pass that token to your web service (again, which I can't use) to use there in whatever way you need it.
However, I'm guessing the token retrieved from getUserIdentityTokenAsync is different and cannot be used. As a simple and hopefully appropriate test, I obtained an OAUTH token for my O365 account and used that as the token using SOAPe for a test GetUserConfiguration call and it worked. I then tried using the token from getUserIdentityTokenAsync and it didn't work (401 Unauthorized).
I concede that this may be a poor test, and I admit that at this point it is unclear to me how a SOAP EWS request from JavaScript in an Outlook dd-in can be authenticated without requiring an explicit user login (hopefully it can). And if it can, how do I get the token I need and how do I use it for this kind of client-side request?
You may want to use ews-javascript-api helper in this case. here is the example on how to use this with Outlook Add-ins.
https://github.com/gautamsi/ews-js-api-browser#working-with-plain-jsts-no-module-loadersbundlers
you may use any allowed api (available in makeEwsRequestAsync) with this library. with similar api what is available in Ews managed Api.

JSON, AJAX, REST Terminology

Currently writing some documentation. Just wondering if we are using the terminology correctly.
We have an AJAX script that calls a service using a HTTP GET that returns JSON.
Would you call the service a REST service or a JSON service?
Using HTTP does not mean you're automatically following the REST architectural style. If you don't know what REST is, you're pretty much guaranteed to not be doing it. Call it "a web service that returns JSON" instead.
I'd call it a REST service which returns JSON.
EDIT
6 years on and what was I thinking! It's a web service which returns Json, as suggested in other answers. It may be RESTful, it may not.
A client calling a service using an HTTP GET would not constitute a RESTful architecture. The following elements should exist for a service that has a RESTful architecture.
HTTP - used as an application protocol, not a transport protocol
URI tunneling
Hypermedia
So, in your scenario, based on the given information, your service can be classified as a regular service with JSON hypermedia or content type. It is definetly not a REST architecture.
Here are some additional information:http://goo.gl/32gLK