You want to implement an API for your client to integrate with your system.
You wonder if you should implement the API using SOAP or REST or GraphQL or gRPC.
Technically speaking SOAP is a protocol (developers must respect the protocol specification when working with it) while REST is an architecture style (Developers may not follow it strictly).
Most of software service providers (e.g. Salesforce, Sharepoint) provide both of them (SOAP and REST) for API clients.
The reason why a software service provider may implement both SOAP and REST is that legacy systems or frameworks (e.g. .NET, Java) often have many mature tools or libraries for consuming SOAP API easily while modern systems or frameworks (e.g. Node.js) often have many available tools/libraries for quickly consuming REST API.
If only one approach has to be chosen in order to reduce development cost then selecting SOAP or REST or GraphQL or gRPC for API implementation should depend on the API clients.
So the strategy below may help us select the most appropirate technology.
- Introducing your system capabilities to your client first.
- Find out the main API technology that the client is using for their back-end services or the API technology that they are most familiar with (e.g. SOAP, REST, GraphQL, gRPC).
- Then implement your API using the client’s API technology. The API can be implemented using a programing language that you are most familiar with.
- Then create the corresponding API developer guide and sample code for the client using their programming language.