Opportunity
The opportunity resource.
Basehttps://rest.carbon.ms/opportunity
GET
/opportunityList opportunitys
Retrieve a paginated list of opportunitys. Filter, order, and select columns with PostgREST query parameters.
Query parameters
selectstringComma-separated columns to return. Defaults to all.
orderstringColumn to sort by, e.g. `createdAt.desc`.
limitintegerMaximum rows to return.
offsetintegerRows to skip, for pagination.
GEThttps://rest.carbon.ms/opportunity
curl --request GET \
--url 'https://rest.carbon.ms/opportunity?select=*&limit=10' \
--header 'Authorization: Bearer <api-key>'Response
[
{
"id": "abc123def456",
"companyId": "xyz789",
"purchaseOrderDocumentPath": "string",
"requestForQuoteDocumentPath": "string",
"customerId": "xyz789"
}
]GET
/opportunityRetrieve a opportunity
Fetch a single opportunity by filtering on `id`.
Query parameters
idstringMatch on the opportunity's `id`, e.g. `eq.{id}`.
GEThttps://rest.carbon.ms/opportunity
curl --request GET \
--url 'https://rest.carbon.ms/opportunity?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'Response
{
"id": "abc123def456",
"companyId": "xyz789",
"purchaseOrderDocumentPath": "string",
"requestForQuoteDocumentPath": "string",
"customerId": "xyz789"
}POST
/opportunityCreate a opportunity
Create a new opportunity.
Body parameters
companyIdstringrequiredReferences company.id
purchaseOrderDocumentPathstringrequestForQuoteDocumentPathstringcustomerIdstringReferences customer.id
POSThttps://rest.carbon.ms/opportunity
curl --request POST \
--url https://rest.carbon.ms/opportunity \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"companyId":"xyz789"}'Response
{
"id": "abc123def456",
"companyId": "xyz789",
"purchaseOrderDocumentPath": "string",
"requestForQuoteDocumentPath": "string",
"customerId": "xyz789"
}PATCH
/opportunityUpdate a opportunity
Update an existing opportunity, matched on `id`.
Body parameters
companyIdstringrequiredReferences company.id
purchaseOrderDocumentPathstringrequestForQuoteDocumentPathstringcustomerIdstringReferences customer.id
PATCHhttps://rest.carbon.ms/opportunity
curl --request PATCH \
--url 'https://rest.carbon.ms/opportunity?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"companyId":"xyz789"}'Response
{
"id": "abc123def456",
"companyId": "xyz789",
"purchaseOrderDocumentPath": "string",
"requestForQuoteDocumentPath": "string",
"customerId": "xyz789"
}DELETE
/opportunityDelete a opportunity
Delete a opportunity, matched on `id`. Returns 204 No Content.
Query parameters
idstringThe `id` of the opportunity to delete, e.g. `eq.{id}`.
DELETEhttps://rest.carbon.ms/opportunity
curl --request DELETE \
--url 'https://rest.carbon.ms/opportunity?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'204 No Content