Contractors API

create new entry

POST /api/rest/admin/contractors

Parameters

Name Description
data[type] Resource type (contractors)
data[attributes][name] Name
data[attributes][vendor] Vendor
data[attributes][customer] Customer
data[attributes][enabled] Enabled
data[attributes][description] Description
data[attributes][address] Address
data[attributes][phones] Phones
data[attributes][external-id] External id
data[relationships][smtp-connection] Smtp connection

Request

Headers

Version: HTTP/1.0
Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
Authorization: eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MzE1Nzg3NTIsInN1YiI6NzJ9.cgEjFrQ8YD2uOScPSONSrBT3QpPqIJfrxViCZAF_tDQ
Host: example.org
Cookie: 

Route

POST /api/rest/admin/contractors

Body

{"data":{"type":"contractors","attributes":{"name":"Contractor name","vendor":true,"customer":true,"enabled":true,"description":"Description","address":"Address","phones":"Phones"}}}

Response

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/vnd.api+json
Vary: Accept
ETag: W/"ee064ecd7c2bf7a54f81a88450a12a50"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 6fb2608b-459b-4b55-b177-84f3876fddce
X-Runtime: 0.012777
Content-Length: 504

Status

201 Created

Body

{
  "data": {
    "id": "56",
    "type": "contractors",
    "links": {
      "self": "http://example.org/api/rest/admin/contractors/56"
    },
    "attributes": {
      "name": "Contractor name",
      "enabled": true,
      "vendor": true,
      "customer": true,
      "description": "Description",
      "address": "Address",
      "phones": "Phones",
      "external-id": null
    },
    "relationships": {
      "smtp-connection": {
        "links": {
          "self": "http://example.org/api/rest/admin/contractors/56/relationships/smtp-connection",
          "related": "http://example.org/api/rest/admin/contractors/56/smtp-connection"
        },
        "data": null
      }
    }
  }
}