Examples

POST /api/v2/premium-service-requests
{
  "data": {
    "type": "premium-service-requests",
    "attributes": {
      "title": null,
      "description": null,
      "time-required": null,
      "smarts-required": null,
      "status": null,
      "status-updated-at": null,
      "completed-at": null,
      "deliver-at": null,
      "updated-at": null,
      "rating": null,
      "feedback": null
    },
    "relationships": {
      "requestor": {
        "data": {
          "type": "requestors",
          "id": 89
        }
      }
    }
  }
}
201
{
  "data": {
    "id": "31",
    "type": "premium-service-requests",
    "links": {
      "self": "http://test.host/api/v2/premium-service-requests/31"
    },
    "attributes": {
      "title": null,
      "description": null,
      "time-required": null,
      "smarts-required": null,
      "status": "drafted",
      "status-updated-at": "2018-01-24T09:59:37.207+08:00",
      "completed-at": null,
      "deliver-at": null,
      "updated-at": "2018-01-24T09:59:37.207+08:00",
      "rating": null,
      "feedback": null
    },
    "relationships": {
      "requestor": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/31/relationships/requestor",
          "related": "http://test.host/api/v2/premium-service-requests/31/requestor"
        }
      },
      "requestee": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/31/relationships/requestee",
          "related": "http://test.host/api/v2/premium-service-requests/31/requestee"
        }
      },
      "manager": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/31/relationships/manager",
          "related": "http://test.host/api/v2/premium-service-requests/31/manager"
        }
      },
      "premium-service": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/31/relationships/premium-service",
          "related": "http://test.host/api/v2/premium-service-requests/31/premium-service"
        }
      },
      "premium-service-attachments": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/31/relationships/premium-service-attachments",
          "related": "http://test.host/api/v2/premium-service-requests/31/premium-service-attachments"
        }
      },
      "premium-service-notes": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/31/relationships/premium-service-notes",
          "related": "http://test.host/api/v2/premium-service-requests/31/premium-service-notes"
        }
      },
      "activities": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/31/relationships/activities",
          "related": "http://test.host/api/v2/premium-service-requests/31/activities"
        }
      },
      "premium-service-activity-notes": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/31/relationships/premium-service-activity-notes",
          "related": "http://test.host/api/v2/premium-service-requests/31/premium-service-activity-notes"
        }
      }
    }
  }
}

Params

Param name Description
data
required

Premium Service Request information

Validations:

  • Must be a Hash

data[type]
required

Validations:

data[attributes]
required

Validations:

  • Must be a Hash

data[attributes][title]
required

Title of the request

Validations:

  • Must be a String

data[attributes][description]
optional , nil allowed

Short description of the request

Validations:

  • Must be a String

data[attributes][time_required]
optional , nil allowed

Time required to finish the request

Validations:

  • Must be a Integer

data[attributes][note]
optional , nil allowed

Notes related to the request

Validations:

  • Must be a String

data[attributes][smarts_required]
optional , nil allowed

Smarts required to fulfill the request

Validations:

  • Must be a Integer

data[attributes][status]
required

Status of the request

Validations:

  • Must be a String

data[relationships]
required

Validations:

  • Must be a Hash

data[relationships][requestee]
required

Validations:

  • Must be a Hash

data[relationships][requestee][data]
required

Validations:

  • Must be a Hash

data[relationships][requestee][data][type]
required

Should be `Account`

Validations:

  • Must be a String

data[relationships][requestee][data][id]
required

Account ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.

data[relationships][premium_service]
required

Validations:

  • Must be a Hash

data[relationships][premium_service][data]
required

Validations:

  • Must be a Hash

data[relationships][premium_service][data][type]
required

Should be `PremiumService`

Validations:

  • Must be a String

data[relationships][premium_service][data][id]
required

PremiumService ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.

data[relationships][premium_service_attachments]
optional , nil allowed

Validations:

  • Must be an Array of nested elements

data[relationships][premium_service_attachments][data]
required

Validations:

  • Must be a Hash

data[relationships][premium_service_attachments][data][type]
required

Should be `PremiumServiceAttachment`

Validations:

  • Must be a String

data[relationships][premium_service_attachments][data][id]
required

PremiumServiceAttachment ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.