Entity Data

Varsha Neelesh
Varsha Neelesh
  • Updated

Read Entity Data

Lists data for a given Syncari entity. Multiple filters can be applied to narrow down the result set further.

Request

Headers

 Name
 Type
 Required
syncariId

Id of the instance the API is to be run against

string
 
clientRequestId
Client side request id to be used for idempotency in the future

 

string
required-table (1).svg

Path Params

 Name
 Type
 Required
entityId

Id of the Syncari entity schema from which data needs to be read

string
required-table (1).svg

Body

 Name
 Type
 Required
Notes
predicates
left
   type
   apiName
operator
right
   value
   type
object
object
string
string
string
object
string
string
 

Allowed values for operator:

eq|ieq|ne|empty|not_empty|starts_with|in|not_in|contains|gt|gte|lt|lte
operator
string
 

Allowed values:

AND|OR
Query Parameters
Name Type Required Notes
cursorToken string  

Use the value from last response to get the next set of records

limit integer  

Limit the number of the records to be returned

Example

Request Sample

curl --request POST \
  --url https://api.syncari.com/api/v1/entities/627b96995bd81012af9b9cd9/data \
  --header 'Accept: application/json' \
  --header 'Authorization: ' \
  --header 'Content-Type: application/json' \
  --header 'syncariId: ' \
  --data '{
  "predicates": [
    {
      "left": {
        "type": "variable",
        "apiName": "email"
      },
      "operator": "eq",
      "right": {
        "value": "test@syncari.com",
        "type": "literal"
      }
    }
  ],
  "operator": "AND"
}'

Response Sample

{
  "success": true,
  "requestId": "5941125775",
  "timestamp": "2022-11-16T03:45:42.974982Z",
  "cursorToken": "NjI3Yjk2OTk1YmQ4MTAxMmFmOWI5Y2Q5",
  "result": [
    {
      "id": "627b96995bd81012af9b9cd9",
      "values": {
        "owner_id": "6274c45aaa913824247c0c97",
        "syncariTimestamp": 1652266649320,
        "subscription_status": 1,
        "creater_id": "6274c45aaa913824247c0c97",
        "sms_subscription_status": 2,
        "tags": [],
        "work_number": "88877766654",
        "lifecycle_stage_id": null,
        "lead_score": 24,
        "sales_account_id": "627b729e5bd81012af9b8018",
        "whatsapp_subscription_status": 2,
        "updater_id": "6274c45aaa913824247c0c97",
        "recent_note": null,
        "lastModified": 1651785305000,
        "last_contacted_sales_activity_mode": null,
        "work_email": null,
        "sales_accounts": [
          "627b729e5bd81012af9b8018"
        ],
        "emails": [
          "testsyncari.com"
        ],
        "last_contacted_via_sales_activity": null,
        "updated_at": null,
        "first_name": "TEST",
        "email": "test@syncari.com",
        "subscription_types": [
          "1",
          "2",
          "3",
          "4",
          "5"
        ],
        "last_assigned_at": "2022-05-05T00:00:00.000+00:00",
        "mobile_number": "9998887776"
      },
      "idMapping": {
        "Freshsales / Contact": "70032198783"
      },
      "dataFitnessIndex": "0",
      "syncariDeleted": false
    }
  ]
}

 

Sample Payloads for Predicates

  • For a single filter, where the request is for data where Type Equals Reseller:
{
"predicates": [{
"left": {
"type": "variable",
"apiName": "Type"
},
"operator": "eq",
"right": {
"value": "Reseller",
"type": "literal"
}
}],
"operator": "AND"
}
  • Below request will filter data where Type Equals Reseller AND Industry Equals Ignore Case retail:
{
"predicates": [{
"left": {
"type": "variable",
"apiName": "Type"
},
"operator": "eq",
"right": {
"value": "Reseller",
"type": "literal"
}
}, {
"left": {
"type": "variable",
"apiName": "Industry"
},
"operator": "ieq",
"right": {
"value": "retail",
"type": "literal"
}
}],
"operator": "AND"
}
  • Below request will filter data where Type Equals Reseller OR Type Starts With Sal:
{
"predicates": [{
"left": {
"type": "variable",
"apiName": "Type"
},
"operator": "eq",
"right": {
"value": "Reseller",
"type": "literal"
}
}, {
"left": {
"type": "variable",
"apiName": "Type"
},
"operator": "starts_with",
"right": {
"value": "Sal",
"type": "literal"
}
}],
"operator": "OR"
}

 

Get Entity Data Count

Lists data for a given Syncari entity. Multiple filters can be applied to narrow down the result set further.

Request

Headers

 Name
 Type
 Required
syncariId

Id of the instance the API is to be run against

string
 
clientRequestId
Client side request id to be used for idempotency in the future

 

string
required-table (1).svg

 

Path Params

 Name
 Type
 Required
entityId

Id of the Syncari entity schema from which data needs to be read

string
required-table (1).svg

 

Body

 Name
 Type
 Required
Notes
predicates
left
   type
   apiName
operator
right
   value
   type
object
object
string
string
string
object
string
string
 

Allowed values for operator:

eq|ieq|ne|empty|not_empty|starts_with|
between|in|not_in
operator
string
 

Allowed values:

AND|OR

 

Example

Request Sample (With Predicates)

curl --request POST \
  --url https://api.syncari.com/api/v1/entities/627b96995bd81012af9b9cd9/count \
  --header 'Accept: application/json' \
--header 'clientRequestId: 3709088566' \
  --header 'Authorization: ' \
  --header 'Content-Type: application/json' \
  --header 'syncariId: ' \
  --data '{
  "predicates": [
    {
      "left": {
        "type": "variable",
        "apiName": "name"
      },
      "operator": "eq",
      "right": {
        "value": "steven",
        "type": "literal"
      }
    }
  ],
  "operator": "AND"
}'

 

Response Sample

{
    "success": true,
    "requestId": "3709088566",
    "timestamp": "2023-09-27T18:44:18.053956Z",
    "result": 2
}

 

Request Sample (Without Predicates)

curl --request POST \
  --url https://api.syncari.com/api/v1/entities/627b96995bd81012af9b9cd9/count \
  --header 'Accept: application/json' \
--header 'clientRequestId: 7168379103' \
  --header 'Authorization: ' \
  --header 'Content-Type: application/json' \
  --header 'syncariId: '

Response Sample

{
    "success": true,
    "requestId": "7168379103",
    "timestamp": "2023-09-27T18:38:54.597990Z",
    "result": 3425
}

 

Share this

Was this article helpful?

0 out of 0 found this helpful