Inspection Sampling Plan

The inspection sampling plan resource.

Basehttps://rest.carbon.ms/inspectionSamplingPlan
GET/inspectionSamplingPlan

List inspection sampling plans

Retrieve a paginated list of inspection sampling plans. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GEThttps://rest.carbon.ms/inspectionSamplingPlan
curl --request GET \
  --url 'https://rest.carbon.ms/inspectionSamplingPlan?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "inspectionId": "xyz789",
    "inspectionFeatureId": "xyz789",
    "sampleSize": 0,
    "acceptanceNumber": 0,
    "rejectionNumber": 0,
    "companyId": "xyz789",
    "createdBy": "string"
  }
]
GET/inspectionSamplingPlan

Retrieve a inspection sampling plan

Fetch a single inspection sampling plan by filtering on `id`.

Query parameters

idstring

Match on the inspection sampling plan's `id`, e.g. `eq.{id}`.

GEThttps://rest.carbon.ms/inspectionSamplingPlan
curl --request GET \
  --url 'https://rest.carbon.ms/inspectionSamplingPlan?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "inspectionId": "xyz789",
  "inspectionFeatureId": "xyz789",
  "sampleSize": 0,
  "acceptanceNumber": 0,
  "rejectionNumber": 0,
  "companyId": "xyz789",
  "createdBy": "string"
}
POST/inspectionSamplingPlan

Create a inspection sampling plan

Create a new inspection sampling plan.

Body parameters

inspectionIdstringrequired

References inspection.id

inspectionFeatureIdstringrequired

References inspectionFeature.id

sampleSizenumberrequired
acceptanceNumbernumberrequired
rejectionNumbernumberrequired
codeLetterstring
companyIdstringrequired

References company.id

POSThttps://rest.carbon.ms/inspectionSamplingPlan
curl --request POST \
  --url https://rest.carbon.ms/inspectionSamplingPlan \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"inspectionId":"xyz789","inspectionFeatureId":"xyz789","sampleSize":0,"acceptanceNumber":0,"rejectionNumber":0,"companyId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "inspectionId": "xyz789",
  "inspectionFeatureId": "xyz789",
  "sampleSize": 0,
  "acceptanceNumber": 0,
  "rejectionNumber": 0,
  "companyId": "xyz789",
  "createdBy": "string"
}
PATCH/inspectionSamplingPlan

Update a inspection sampling plan

Update an existing inspection sampling plan, matched on `id`.

Body parameters

inspectionIdstringrequired

References inspection.id

inspectionFeatureIdstringrequired

References inspectionFeature.id

sampleSizenumberrequired
acceptanceNumbernumberrequired
rejectionNumbernumberrequired
codeLetterstring
companyIdstringrequired

References company.id

PATCHhttps://rest.carbon.ms/inspectionSamplingPlan
curl --request PATCH \
  --url 'https://rest.carbon.ms/inspectionSamplingPlan?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"inspectionId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "inspectionId": "xyz789",
  "inspectionFeatureId": "xyz789",
  "sampleSize": 0,
  "acceptanceNumber": 0,
  "rejectionNumber": 0,
  "companyId": "xyz789",
  "createdBy": "string"
}
DELETE/inspectionSamplingPlan

Delete a inspection sampling plan

Delete a inspection sampling plan, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the inspection sampling plan to delete, e.g. `eq.{id}`.

DELETEhttps://rest.carbon.ms/inspectionSamplingPlan
curl --request DELETE \
  --url 'https://rest.carbon.ms/inspectionSamplingPlan?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content