GET /api/v2/premium-service-requests
List of current account Premium Service Requests

Examples

GET /api/v2/premium-service-requests
200
{
  "data": [
    {
      "id": "27",
      "type": "premium-service-requests",
      "links": {
        "self": "http://test.host/api/v2/premium-service-requests/27"
      },
      "attributes": {
        "title": "Service Request",
        "description": null,
        "time-required": null,
        "smarts-required": null,
        "status": "submitted",
        "status-updated-at": "2018-01-24T09:59:35.933+08:00",
        "completed-at": null,
        "deliver-at": null,
        "updated-at": "2018-01-24T09:59:35.933+08:00",
        "rating": null,
        "feedback": null
      },
      "relationships": {
        "requestor": {
          "links": {
            "self": "http://test.host/api/v2/premium-service-requests/27/relationships/requestor",
            "related": "http://test.host/api/v2/premium-service-requests/27/requestor"
          }
        },
        "requestee": {
          "links": {
            "self": "http://test.host/api/v2/premium-service-requests/27/relationships/requestee",
            "related": "http://test.host/api/v2/premium-service-requests/27/requestee"
          }
        },
        "manager": {
          "links": {
            "self": "http://test.host/api/v2/premium-service-requests/27/relationships/manager",
            "related": "http://test.host/api/v2/premium-service-requests/27/manager"
          }
        },
        "premium-service": {
          "links": {
            "self": "http://test.host/api/v2/premium-service-requests/27/relationships/premium-service",
            "related": "http://test.host/api/v2/premium-service-requests/27/premium-service"
          }
        },
        "premium-service-attachments": {
          "links": {
            "self": "http://test.host/api/v2/premium-service-requests/27/relationships/premium-service-attachments",
            "related": "http://test.host/api/v2/premium-service-requests/27/premium-service-attachments"
          }
        },
        "premium-service-notes": {
          "links": {
            "self": "http://test.host/api/v2/premium-service-requests/27/relationships/premium-service-notes",
            "related": "http://test.host/api/v2/premium-service-requests/27/premium-service-notes"
          }
        },
        "activities": {
          "links": {
            "self": "http://test.host/api/v2/premium-service-requests/27/relationships/activities",
            "related": "http://test.host/api/v2/premium-service-requests/27/activities"
          }
        },
        "premium-service-activity-notes": {
          "links": {
            "self": "http://test.host/api/v2/premium-service-requests/27/relationships/premium-service-activity-notes",
            "related": "http://test.host/api/v2/premium-service-requests/27/premium-service-activity-notes"
          }
        }
      }
    }
  ],
  "meta": {
    "total-pages": 1,
    "record-count": 1
  },
  "links": {
    "first": "http://test.host/api/v2/premium-service-requests?filter%5Bfulltext%5D=Service+Request&page%5Bnumber%5D=1&page%5Bsize%5D=10",
    "last": "http://test.host/api/v2/premium-service-requests?filter%5Bfulltext%5D=Service+Request&page%5Bnumber%5D=1&page%5Bsize%5D=10"
  }
}

GET /api/v2/premium-service-requests/:id
Show a Premium Service Request

Examples

GET /api/v2/premium-service-requests/25
200
{
  "data": {
    "id": "25",
    "type": "premium-service-requests",
    "links": {
      "self": "http://test.host/api/v2/premium-service-requests/25"
    },
    "attributes": {
      "title": "Service Request",
      "description": null,
      "time-required": null,
      "smarts-required": null,
      "status": "submitted",
      "status-updated-at": "2018-01-24T09:59:35.132+08:00",
      "completed-at": null,
      "deliver-at": null,
      "updated-at": "2018-01-24T09:59:35.132+08:00",
      "rating": null,
      "feedback": null
    },
    "relationships": {
      "requestor": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/25/relationships/requestor",
          "related": "http://test.host/api/v2/premium-service-requests/25/requestor"
        }
      },
      "requestee": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/25/relationships/requestee",
          "related": "http://test.host/api/v2/premium-service-requests/25/requestee"
        }
      },
      "manager": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/25/relationships/manager",
          "related": "http://test.host/api/v2/premium-service-requests/25/manager"
        }
      },
      "premium-service": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/25/relationships/premium-service",
          "related": "http://test.host/api/v2/premium-service-requests/25/premium-service"
        }
      },
      "premium-service-attachments": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/25/relationships/premium-service-attachments",
          "related": "http://test.host/api/v2/premium-service-requests/25/premium-service-attachments"
        }
      },
      "premium-service-notes": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/25/relationships/premium-service-notes",
          "related": "http://test.host/api/v2/premium-service-requests/25/premium-service-notes"
        }
      },
      "activities": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/25/relationships/activities",
          "related": "http://test.host/api/v2/premium-service-requests/25/activities"
        }
      },
      "premium-service-activity-notes": {
        "links": {
          "self": "http://test.host/api/v2/premium-service-requests/25/relationships/premium-service-activity-notes",
          "related": "http://test.host/api/v2/premium-service-requests/25/premium-service-activity-notes"
        }
      }
    }
  }
}

Params

Param name Description
id
required

Premium Service Request 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.


POST /api/v2/premium-service-requests
Create a Premium Service Request

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.


PATCH /apiv2/premium-service-requests/:id
Update a Premium Service Request

Examples

PATCH /api/v2/premium-service-requests/11
{
  "data": {
    "id": "11",
    "type": "premium-service-requests",
    "attributes": {
      "title": "A new title",
      "description": null,
      "time-required": null,
      "smarts-required": null,
      "status": "submitted",
      "status-updated-at": "2018-01-24 09:59:29 +0800",
      "completed-at": null,
      "deliver-at": null,
      "updated-at": "2018-01-24 09:59:29 +0800",
      "rating": null,
      "feedback": null
    }
  }
}
400
{
  "errors": [
    {
      "title": "Param not allowed",
      "detail": "title is not allowed.",
      "code": "105",
      "status": "400"
    },
    {
      "title": "Param not allowed",
      "detail": "description is not allowed.",
      "code": "105",
      "status": "400"
    },
    {
      "title": "Param not allowed",
      "detail": "smarts-required is not allowed.",
      "code": "105",
      "status": "400"
    },
    {
      "title": "Param not allowed",
      "detail": "rating is not allowed.",
      "code": "105",
      "status": "400"
    },
    {
      "title": "Param not allowed",
      "detail": "feedback is not allowed.",
      "code": "105",
      "status": "400"
    }
  ]
}

Params

Param name Description
id
required

Premium Service Request 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
required

Premium Service Request information

Validations:

  • Must be a Hash

data[type]
optional

Validations:

data[attributes]
optional

Validations:

  • Must be a Hash

data[attributes][title]
optional

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]
optional

Status of the request

Validations:

  • Must be a String

data[relationships]
optional

Validations:

  • Must be a Hash

data[relationships][requestee]
optional

Validations:

  • Must be a Hash

data[relationships][requestee][data]
optional

Validations:

  • Must be a Hash

data[relationships][requestee][data][type]
optional

Should be `Account`

Validations:

  • Must be a String

data[relationships][requestee][data][id]
optional

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]
optional

Validations:

  • Must be a Hash

data[relationships][premium_service][data]
optional

Validations:

  • Must be a Hash

data[relationships][premium_service][data][type]
optional

Should be `PremiumService`

Validations:

  • Must be a String

data[relationships][premium_service][data][id]
optional

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]
optional

Validations:

  • Must be a Hash

data[relationships][premium_service_attachments][data][type]
optional

Should be `PremiumServiceAttachment`

Validations:

  • Must be a String

data[relationships][premium_service_attachments][data][id]
optional

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.


DELETE /apiv2/premium-service-requests/:id
Delete a Premium Service Request

Examples

DELETE /api/v2/premium-service-requests/10
{}
401
{
  "errors": [
    {
      "title": "You are not authorized to access this request"
    }
  ]
}

Params

Param name Description
id
required

Premium Service Request 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.