Material Grade

The material grade resource.

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

List material grades

Retrieve a paginated list of material grades. 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/materialGrade
curl --request GET \
  --url 'https://rest.carbon.ms/materialGrade?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "materialSubstanceId": "xyz789",
    "name": "Example",
    "companyId": "xyz789"
  }
]
GET/materialGrade

Retrieve a material grade

Fetch a single material grade by filtering on `id`.

Query parameters

idstring

Match on the material grade's `id`, e.g. `eq.{id}`.

GEThttps://rest.carbon.ms/materialGrade
curl --request GET \
  --url 'https://rest.carbon.ms/materialGrade?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "materialSubstanceId": "xyz789",
  "name": "Example",
  "companyId": "xyz789"
}
POST/materialGrade

Create a material grade

Create a new material grade.

Body parameters

materialSubstanceIdstringrequired

References materialSubstance.id

namestringrequired
companyIdstring

References company.id

POSThttps://rest.carbon.ms/materialGrade
curl --request POST \
  --url https://rest.carbon.ms/materialGrade \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"materialSubstanceId":"xyz789","name":"Example"}'
Response
{
  "id": "abc123def456",
  "materialSubstanceId": "xyz789",
  "name": "Example",
  "companyId": "xyz789"
}
PATCH/materialGrade

Update a material grade

Update an existing material grade, matched on `id`.

Body parameters

materialSubstanceIdstringrequired

References materialSubstance.id

namestringrequired
companyIdstring

References company.id

PATCHhttps://rest.carbon.ms/materialGrade
curl --request PATCH \
  --url 'https://rest.carbon.ms/materialGrade?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"materialSubstanceId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "materialSubstanceId": "xyz789",
  "name": "Example",
  "companyId": "xyz789"
}
DELETE/materialGrade

Delete a material grade

Delete a material grade, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the material grade to delete, e.g. `eq.{id}`.

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