Returns how many records are currently in a prioritized view. Add a user ID to get the count as that user sees it.
POSThttps://secure-api.setshape.com/api/prioritizeview/count/{crmid}
Replace
{crmid} with your CRM ID, the Shape system ID that belongs to your API key. Send the standard headers on every request: Authorization: YOUR_API_AUTHORIZATION_KEY and Content-Type: application/json. See Authentication.Parameters
| Parameter | Where | Required | Description |
|---|---|---|---|
crmid |
Path | Required | Your Shape system ID. |
pid |
Body | Required | The prioritized view’s ID. Open the view in Shape and look for pid= in your browser’s address bar. For example, in …/accounts?pid=337 the pid is 337. |
record_type |
Body | Required | The record type the view applies to, such as prospects. Use the record type’s name from Get Record Types, in lowercase, with hyphens instead of spaces: Referral Partners becomes referral-partners. |
user_id |
Body | Optional | A user ID from Get Users. Leave it out to count every record in the view, as an administrator sees it. |
pid, user_id and record_type can be sent as text or numbers. The count uses the view’s own saved rules; there’s no date filter.
Example request
{
"pid": "234",
"user_id": "1024",
"record_type": "prospects"
}
Example response
{
"message": "success",
"totalRecords": 122,
"systemId": 1360
}
Errors
| Situation | Status | Response |
|---|---|---|
pid or record_type missing |
404 | {"message": "Bad input parameter"} |
record_type not recognized |
404 | {"message": "Invalid Record Type."} |
user_id isn’t an active user |
404 | {"message": "Invalid User: 1024"} |
Unknown pid, or the view doesn’t apply to that record type or user |
404 | {"message": "This prioritization rule does not apply to this request. Please check rule settings in CRM that prioritization rule is allowed for these request parameters."} |
| The count couldn’t be calculated | 503 | {"message": "Unable to calculate priority count"} |