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

Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
Authorization: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOjY2LCJhdWQiOlsiYWRtaW4iXSwiZXhwIjoxNzcyMjEyMDAxfQ.W_iUPM4pZBxkkKwQNNMNdEyRn6g-NqUYwspYT-X8xQg
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-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
content-type: application/vnd.api+json
location: http://example.org/api/rest/admin/contractors/33
vary: Accept
etag: W/"a2b9e305cf2e5fdc2b9596df2119b457"
cache-control: max-age=0, private, must-revalidate
x-request-id: ccda8140-8e97-46f2-9d09-b00e4ae5f27e
x-runtime: 0.009107
content-length: 504

Status

201 Created

Body

{
  "data": {
    "id": "33",
    "type": "contractors",
    "links": {
      "self": "http://example.org/api/rest/admin/contractors/33"
    },
    "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/33/relationships/smtp-connection",
          "related": "http://example.org/api/rest/admin/contractors/33/smtp-connection"
        },
        "data": null
      }
    }
  }
}