REST API Concepts
An API specifies how software components should interact with each other.
The following are some of the important concepts to know before using the Q2 Loan Servicing and Q2 Marketplace API (Application Programming Interface):
A. The Q2 Loan Servicing and Q2 Marketplace API is organized around REST (Representational State Transfer) and is designed to have predictable and resource-oriented URLs (Uniform Resource Locators).
B. The API is designed to use the following:
- HTTP (HyperText Transfer Protocol) response codes to indicate the API Errors
- Built-in HTTP features such as the HTTP verbs which can be understood by off-the-shelf HTTP clients.
- Standard Salesforce authentication protocol.
C. JSON (JavaScript Object Notation) is returned in all responses from Web Services, including errors, and is the expected input format of requests in POST methods.
D. The expected request parameters including mandatory fields and the request method (GET or POST) along with the expected responses for all the Web Services provided by Q2 Loan Servicing and Q2 Marketplace are described here.
E. Understanding the request: The requested URL is typically structured as follows:
F. Reading the response: The response from any Web Service is organized and can be interpreted as follows:
G. Authentication to the API occurs by a Salesforce authentication. When you request for data from Salesforce within the external application, you must be authenticated by Salesforce. The authentication contains several steps, as dictated by the OAuth standard.
For more information, seehere.
H. Errors: All the errors are returned in JSON.
The HTTP status codes can be summarized as shown in the table below:
HTTP Status Code | Diagnosis |
---|---|
200 OK | Everything worked |
400 Bad Request | Invalid parameter or data integrity issue |
401 Unauthorized | Authentication error |
404 Not Found | Resource not found |
405 Method Not Allowed | Method not supported by the resource |
500 Internal Server Error | Platform Internal Server error |