Advocate Program Bulk Import Methods
Last updated
curl -X POST 'https://app.referralsaasquatch.com/api/v1/{tenant_alias}/export/upload' \
-u :{tenant_api_key} \
--form 'file=@my_file.csv'{
"fileRef": "imports/test_akdq8a9wyvzba/userEvents_63323378e1edcd44b03eed9a.jsonl"
}curl -X POST 'https://app.referralsaasquatch.com/api/v1/{tenant_alias}/graphql' \
-u :{tenant_api_key} \
-H "Content-Type: application/json" \
-d '{
"operationName": "validate",
"variables": {
"jobInput": {
"fileRef": "{file_ref}",
"type": "{job_type}"
}
},
"query": "query validate($jobInput: JobInput!) {validateJobCreation(jobInput: $jobInput) { errors }}"
}'{
"data": {
"validateJobCreation": {
"errors": []
}
}
}curl -X POST 'https://app.referralsaasquatch.com/api/v1/{tenant_alias}/graphql' \
-u :{tenant_api_key} \
-H "Content-Type: application/json" \
-d '{
"variables": {
"jobInput": {
"type": "{job_type}",
"outputFormat": "CSV",
"fileRef": "{file_ref}"
}
},
"query": "mutation ($jobInput: JobInput!) { createJob(jobInput: $jobInput) {id type requester dateCreated}}"
}'{
"data": {
"createJob": {
"id": "633b1cf34efc053cb50a3f6d",
"type": "MUTATION/USER_EVENT",
"requester": "API",
"dateCreated": 1664818419661
}
}
}curl -X POST 'https://app.referralsaasquatch.com/api/v1/{tenant_alias}/graphql' \
-u :{tenant_api_key} \
-H "Content-Type: application/json" \
-d '{
"variables": {
"id": "{job_id}"
},
"query": "query ($id: ID!) { job(id: $id) { status stats { recordsProcessed }}}"
}'{
"data": {
"job": {
"status": "COMPLETED",
"stats": {
"recordsProcessed": 22
}
}
}
}