---
title: "REST API Requests"
description: "REST API Requests"
keywords: "REST API Requests"
url: "https://www.myrapidi.com/wiki/rest_api_requests"
locale: "en"
published: "2017-08-01T17:55:04Z"
modified: "2023-04-03T08:52:37Z"
---

The base URL of the API is https://api.myrapidi.com/api/v2

All GET, POST, PUT, PATCH and DELETE requests are [JSON](http://en.wikipedia.org/wiki/JSON) or [JSON API](http://www.jsonapi.org "JSON API")encoded and must have content type of application/json or application/vnd.api+json respectively, or the API will return a 415 Unsupported Media Type status code.

In the HTTP Header you must set "Accept" for all requests and you must set "Content-Type" for POST, PUT and PATCH request (all requests that include json data). See the example below.

#### JSON Bodies

```
curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/json"
  -H "Accept: application/json"
   -X PATCH 
  -d "{\"code\":\"INVOICE\",\"description\":\"Invoice Transfers\"}"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/groups/[GROUP ID]
```

The out-put for this example would be:

```
{
  "code": "INVOICE",
  "description": "Invoice Transfers",
  "comments":
}
```

#### JSON API Bodies

```
curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/vnd.api+json" 
  -H "Accept: application/vnd.api+json"
  -X PATCH
  -d "{\"data\":{\"id\":\"5\",\"type\":\"groups\",\"attributes\":{\"code\":\"INVOICE\",\"description\":\"Invoice Transfers\"} }}"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/groups/[GROUP ID]
```

The out-put for this example would be:

```
{
  "data":{
    "id":"5"
    "type":"groups",
    "attributes":{
      "code": "INVOICE",
      "description": "Invoice Transfers"
    },
    "relationships":{
      "comments": {
        "data": [
        ]
    }
  }
}
```

#### HTTP Verbs

We use standard HTTP verbs to indicate the intent of a request:

- GET - To retrieve a resource or a collection of resources
- POST - To create a resource
- PATCH - To modify a resource
- PUT - To update a resource (all fields) - in general, you should use PATCH rather than PUT !
- DELETE - To delete a resource

#### Limited HTTP Clients

If you are using an HTTP client that doesn't support PUT, PATCH, or DELETE requests, send a POST request with an X-HTTP-Method-Override header specifying the desired verb.

#### Example in JSON

```
curl 
  -H Authorization: Bearer [API SECURITY TOKEN]
  -H "Content-Type: application/json" 
  -H "Accept: application/json"
  -X POST
  -H "X-HTTP-Method-Override: DELETE"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/groups/[GROUP ID]
```

#### Example in JSON APi

```
curl 
  -H Authorization: Bearer [API SECURITY TOKEN]
  -H "Content-Type: application/vnd.api+json"
  -H "Accept: application/vnd.api+json"
  -X POST
  -H "X-HTTP-Method-Override: DELETE"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/groups/[GROUP ID]
```
