Subscribe to Changes
Overview
Subscribe to employee profile changes by:
Submitting a list of employee IDs
Querying employee profiles using Search filters
Querying employee profiles using the Elasticsearch DSL schema.
Choose the subscription method that fits you best
Use Elasticsearch to specify the changes you want to be notified about.
Use search filters to specify the changes you want to be notified about.
Submit profile IDs to be notified of changes in that specific range.
Elasticsearch DSL requests
Use endpoint /v2/subscriptions/employee_base/es_dsl
to specify a range of profiles you want to see the updates from.
The following filters are not available in the subscription Elasticsearch DSL requests:
created
last_updated
When creating a new subscription based on Elasticsearch DSL query to the Base Employee endpoints, we strongly advise including the following clause in your query:
"term": { "is_parent": 1 }
This ensures that you get the most out of our new systematic approach to exclude duplicate records, which we can resolve with the same profile.
Endpoint usage
Prepare your request using the following request by adding select filters and your webhook URL to the template:
Change
webhook_url
to yours.Insert your Elasticsearch query in the
"es_dsl_query": {}
section.Insert your API Key token instead of
{API Key}
.
curl -X 'POST' \
'https://api.coresignal.com/cdapi/v2/subscriptions/employee_base/es_dsl' \
-H 'accept: application/json' \
-H 'apikey: {API Key}' \
-H 'Content-Type: application/json' \
-d '{
"webhook_url": "{your_webhook_url}",
"es_dsl_query": {}
}'
For example:
curl -X 'POST' \
'https://api.coresignal.com/cdapi/v2/subscriptions/employee_base/es_dsl' \
-H 'accept: application/json' \
-H 'apikey: {API Key}' \
-H 'Content-Type: application/json' \
-d '{
"webhook_url": "{your_webhook_url}",
"es_dsl_query": {
"query": {
"match": {
"full_name": {
"query": "John Smith",
"operator": "and"
}
}
}
}
}'
Import the cURL to any API-compatible application.
Send the request.
You will start receiving updates via webhooks the next day. Updates will be sent daily.
You will see a subscription ID as an output for your POST request. Save this ID for later. You can use it to find your subscription through subscription management endpoints. You can retrieve employee data using the employee IDs visible in the webhook text.
Search filters requests
Use endpoint /v2/subscriptions/employee_base/filter
to specify a range of profiles you want to see the updates from:
The following filters are not available in the subscription Search filter requests:
created_at_gte
andcreated_at_lte
updated_at_gte
andupdated_at_lte
.
Endpoint usage
Prepare your request using the following request by adding select filters and your webhook URL to the template:
Insert your API Key instead of
{API Key}
.Add the selected filters in the
"filters": {}
section.Change
webhook_url
to yours.
curl -X 'POST' \
'https://api.coresignal.com/cdapi/v2/subscriptions/employee_base/filter' \
-H 'accept: application/json' \
-H 'apikey: {API Key}' \
-H 'Content-Type: application/json' \
-d '{
"webhook_url": "{your_webhook_url}",
"filters": {}
}'
For example:
curl -X 'POST' \
'https://api.coresignal.com/cdapi/v2/subscriptions/employee_base/filter' \
-H 'accept: application/json' \
-H 'apikey: {API Key}' \
-H 'Content-Type: application/json' \
-d '{
"webhook_url": "{your_webhook_url}",
"filters": {"experience_title": "Product Owner"}
}'
Import the prepared cURL request to any API-compatible application.
Send the request.
You will start receiving updates via webhooks the next day. Updates will be sent daily.
You will see a subscription ID as an output for your POST request. Save this ID for later. You can use it to find your subscription through subscription management endpoints. You can retrieve employee data using the employee IDs visible in the webhook text.
IDs requests
Use the endpoint /v2/subscriptions/employee_base/ids
to submit a list of IDs to subscribe to changes in a range of profiles.
Endpoint usage
Prepare your request using the following request by adding select filters and your webhook URL to the template:
Insert your API Key instead of
{API Key}
.Change
webhook_url
to yours.Add the list of IDs
curl -X 'POST' \
'https://api.coresignal.com/cdapi/v2/subscriptions/employee_base/ids' \
-H 'accept: application/json' \
-H 'apikey: {API Key}' \
-H 'Content-Type: multipart/form-data' \
-d '{
"webhook_url": "{webhook_url}",
"ids": [
1,
222,
3456
]
}'
Import the edited cURL request to Postman or any other API-compatible application.
Send the request.
You will start receiving updates via webhooks the next day. Updates will be sent daily.
You will see a subscription ID as an output for your POST request. Save this ID for later. You can use it to find your subscription through subscription management endpoints. You can retrieve employee data using the employee IDs visible in the webhook text.
Following steps
Single profile update
You have received a webhook notification about an update in one employee profile:
{
"member_id": 123,
"status": "started_matching_query"
}
To see the exact changes in the profile, you will have to use the profile ID in the following endpoint:
GET
/v2/employee_base/collect/{employee_id}
Multiple profile updates
You have received a webhook notification about updates in several employee profiles:
{
"member_id": 123,
"status": "started_matching_query"
},
{
"member_id": 124,
"status": "stopped_matching_query"
},
{
"member_id": 125,
"status": "changed"
}
To identify the changes in these profiles, you need to export the employee IDs in a CSV or TXT file and use them with the following Bulk Collect endpoints:
POST
/v2/data_requests/employee_base/ids
GET
/v2/data_requests/{data_request_id}/files
GET
/v2/data_requests/{data_request_id}/files/{file_name}
Follow the instructions here to successfully collect the employee data (from left to right):
Last updated
Was this helpful?