Parameters
The details of what you want to do.
What are parameters?
Parameters, or "params," are sets of values you can include in your requests. Some parameters are required for certain operations, while others are optional.
Let's take a look at this example request:
GET https://restapi.rev.io/v1/Customers/1001
The GET is the request method, while the https://restapi.rev.io/v1/Customers is the request endpoint. What's left is our parameter value: 1001. In this case, this value is being passed for the ID parameter.
When we receive this request, we'll know you want to access the customer with an ID of 1001. Without this parameter, we wouldn't know which customer you were looking for.
What types of parameters are there?
There are a couple types of parameters.
Path
The ID parameter in our example above is what we call a path parameter. These are so called because they're included in the main path, or address, of the request. You replace the parameter with your value.
Example: restapi.rev.io/v1/Customers/id
Query
Query parameters come after the main path of the request, preceded by a question mark (?) and joined by ampersands (&). You put your value after the parameter name, joined by an equals sign (=).
Example: restapi.rev.io/v1/Orders?status=COMPLETE&order_type=DISCONNECT'
A note about search parameters
In the API explorer, query parameters for search actions (such as searching for customers) are prefixed with "search." You don't have to include that prefix in your requests. For example, instead of specifying a search.customer_id, you can just send us a customer_id.
Body
Body parameters don't appear in the request address at all. They are sent separately in what is called the body of the request. You can send these parameters in different ways depending on the content type you choose.
Example: {"customer_id":10234,"body":"This is a test note."}
Updated almost 7 years ago