cURL Exaples
Purpose
The purpose of this document is to provide a set of cURL examples which may be used to learn and setup the PII Vault API endpoints. The target audience for this document are software developers who understand the cURL command line tool and can use it to setup their own API calls.
Use the [Account ID] and [API Key] provided by Anonomatic to get a Bearer Token
curl \
-X POST “https://api.piivault.com/api/auth/login” \
-H “Content-Type: application/json” \
-d ‘{ “AccountId”: “[Account ID]”, “ApiKey”: “[API Key]” }’ \
> api-token.txt
Copy the token from the JSON Payload of the above response to here
API_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJEYXRhYmFzZUlkIjoiUElJVmF1bHREYXRhIiwiU3Vic2NyaXB0aW9uSWQiOiI2ODliYTExYi1jNDcwLTRlMDItOTY0MS1lZTY3NTFiYjg1YTUiLCJBY2NvdW50SWQiOiIyMzkzODVmYi0zOTYzLTQxMWYtYTY0NC0yOTYzNzZmY2ExNWQiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiTGluZHNheSBMYXdyZW5jZSIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2VtYWlsYWRkcmVzcyI6Imxhd3JlbmNlLmxpbmRzYXlqb2huQGdtYWlsLmNvbSIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6WyJTdWJzY3JpYmVyIiwiQXBpQWNjZXNzIl0sImV4cCI6MTYxNzA2OTQzMSwiaXNzIjoiaHR0cHM6Ly9hcGkucGlpdmF1bHQuY29tIiwiYXVkIjoiaHR0cHM6Ly9hcGkucGlpdmF1bHQuY29tIn0.IR–JD-9344sDqUcgkbZ8rlj8ftEe3Qv5kT3XzPXjus
Try out the APIs below!
GetPolyId (Put)
Pass a single profile to PII Vault and receive a single PolyId in response
curl -v \
-X PUT “https://api.piivault.com/api/profiles/GetPolyId” \
-H “Authorization: Bearer ${API_TOKEN}” \
-H “Content-Type: application/json” \
-H “Content-Type: application/json” -d @test-profile.json
PolyIdBulk (Put)
Pass a collection of profiles to PII Vault and receive a PolyId for each profile
curl -v \
-X PUT “https://api.piivault.com/api/profiles/GetPolyIdBulk” \
-H “Authorization: Bearer ${API_TOKEN}” \
-H “Content-Type: application/json” \
-H “Content-Type: application/json” -d @test-profiles.json
DeleteProfile (Put)
Completely delete/purge a single profile from the vault.
curl -v \
-X PUT “https://api.piivault.com/api/profiles/DeleteProfile” \
-H “Authorization: Bearer ${API_TOKEN}” \
-H “Content-Type: application/json” \
-H “Content-Type: application/json” -d @test-delete-profile.json
ForgetProfile (Put)
Mark a single profile as forgotten. This will exclude it from matching.
curl -v \
-X PUT “https://api.piivault.com/api/profiles/ForgetProfile” \
-H “Authorization: Bearer ${API_TOKEN}” \
-H “Content-Type: application/json” \
-H “Content-Type: application/json” -d @test-forget-profile.json
PurgeAccountProfiles (Put)
Completely purge all profiles previously sent from this account. Very useful for testing.
curl -v \
-X PUT “https://api.piivault.com/api/profiles/PurgeAccountProfiles” \
-H “Authorization: Bearer ${API_TOKEN}” \
-H “Content-Length: 0”
Example JSON to use in the above tests
Single Profile (File: test-profile.json)
{
“Index”: 1,
“SourceSystemKey”: “1741204973776210”,
“FirstName”: “Lindsay”,
“MiddleName”: “Musicality”,
“LastName”: “Malarkey”,
“OrgName”: “IslandBuoys”,
“DateOfBirth”: “2021-03-29T22:32:25.918Z”,
“Gender”: “M”,
“IsForgotten”: 0,
“Emails”: [
{
“EmailAddress”: “somewhere@rainbow.ky”
}
],
“Phones”: [
{
“PhoneType”: “Mobile”,
“PhoneOwner”: “XFinity”,
“PhoneNumber”: “415.123.5813”
}
],
“Addresses”: [
{
“AddressType”: “Home”,
“StreetAddress1”: “1076 SoulBeats Lane”,
“StreetAddress2”: “Apt #97”,
“StreetAddress3”: “string”,
“StreetAddress4”: “string”,
“City”: “Jamaical”,
“StateCode”: “CA”,
“PostalCode”: “94549”,
“County”: “BlueMoutain”,
“Country”: “USA”
}
],
“Keys”: [
{
“KeyType”: “Secret”,
“KeyOwner”: “Anonomatic”,
“KeyValue”: “bU04XHfENraRXDt0P3CkZhwAOQ55vteV”
}
],
“SourceSystemName”: “Anonomatic”,
“SubSourceSystemName”: “PolyIdTest”
}
Multiple Profiles (File: test-profiles.json)
{
“Profiles”: [
{
“Index”: 2,
“SourceSystemKey”: “0058749309706311”,
“FirstName”: “Robert”,
“MiddleName”: “Musicality”,
“LastName”: “Marlarkey”,
“OrgName”: “IslandBuoys”,
“DateOfBirth”: “2021-03-29T22:32:25.918Z”,
“Gender”: “M”,
“IsForgotten”: 0,
“Emails”: [
{
“EmailAddress”: “somewhere@rainbow.ky”
}
],
“Phones”: [
{
“PhoneType”: “Mobile”,
“PhoneOwner”: “XFinity”,
“PhoneNumber”: “415.123.5813”
}
],
“Addresses”: [
{
“AddressType”: “Home”,
“StreetAddress1”: “1076 SoulBeats Lane”,
“StreetAddress2”: “Apt #97”,
“StreetAddress3”: “string”,
“StreetAddress4”: “string”,
“City”: “Jamaical”,
“StateCode”: “CA”,
“PostalCode”: “94549”,
“County”: “BlueMoutain”,
“Country”: “USA”
}
],
“Keys”: [
{
“KeyType”: “Secret”,
“KeyOwner”: “Anonomatic”,
“KeyValue”: “bU04XHfENraRXDt0P3CkZhwAOQ55vteV”
}
],
“SourceSystemName”: “Anonomatic”,
“SubSourceSystemName”: “PolyIdTest”
},
{
“Index”: 3,
“SourceSystemKey”: “4288088705605929”,
“FirstName”: “Robert”,
“MiddleName”: “Musicality”,
“LastName”: “Malarkey”,
“OrgName”: “IslandBuoys”,
“DateOfBirth”: “2021-03-29T22:32:25.918Z”,
“Gender”: “M”,
“IsForgotten”: 0,
“Emails”: [
{
“EmailAddress”: “somewhere@rainbow.ky”
}
],
“Phones”: [
{
“PhoneType”: “Mobile”,
“PhoneOwner”: “XFinity”,
“PhoneNumber”: “415.123.5813”
}
],
“Addresses”: [
{
“AddressType”: “Home”,
“StreetAddress1”: “1076 SoulBeats Lane”,
“StreetAddress2”: “Apt #97”,
“StreetAddress3”: “string”,
“StreetAddress4”: “string”,
“City”: “Jamaical”,
“StateCode”: “CA”,
“PostalCode”: “94549”,
“County”: “BlueMoutain”,
“Country”: “USA”
}
],
“Keys”: [
{
“KeyType”: “Secret”,
“KeyOwner”: “Anonomatic”,
“KeyValue”: “bU04XHfENraRXDt0P3CkZhwAOQ55vteV”
}
],
“SourceSystemName”: “Anonomatic”,
“SubSourceSystemName”: “PolyIdTest”
},
{
“Index”: 4,
“SourceSystemKey”: “8556446364791439”,
“FirstName”: “Robert”,
“MiddleName”: “Musicality”,
“LastName”: “Malarkey”,
“OrgName”: “IslandBuoys”,
“DateOfBirth”: “2021-03-29T22:32:25.918Z”,
“Gender”: “M”,
“IsForgotten”: 0,
“Emails”: [
{
“EmailAddress”: “somewhere@rainbow.ky”
}
],
“Phones”: [
{
“PhoneType”: “Mobile”,
“PhoneOwner”: “XFinity”,
“PhoneNumber”: “415.123.5813”
}
],
“Addresses”: [
{
“AddressType”: “Home”,
“StreetAddress1”: “1076 SoulBeats Lane”,
“StreetAddress2”: “Apt #97”,
“StreetAddress3”: “string”,
“StreetAddress4”: “string”,
“City”: “Jamaical”,
“StateCode”: “CA”,
“PostalCode”: “94549”,
“County”: “BlueMoutain”,
“Country”: “USA”
}
],
“Keys”: [
{
“KeyType”: “Secret”,
“KeyOwner”: “Anonomatic”,
“KeyValue”: “bU04XHfENraRXDt0P3CkZhwAOQ55vteV”
}
],
“SourceSystemName”: “Anonomatic”,
“SubSourceSystemName”: “PolyIdTest”
},
{
“Index”: 5,
“SourceSystemKey”: “0474913040034848”,
“FirstName”: “Robert”,
“MiddleName”: “Musicality”,
“LastName”: “Malarkey”,
“OrgName”: “IslandBuoys”,
“DateOfBirth”: “2021-03-29T22:32:25.918Z”,
“Gender”: “M”,
“IsForgotten”: 0,
“Emails”: [
{
“EmailAddress”: “somewhere@rainbow.ky”
}
],
“Phones”: [
{
“PhoneType”: “Mobile”,
“PhoneOwner”: “XFinity”,
“PhoneNumber”: “415.123.5813”
}
],
“Addresses”: [
{
“AddressType”: “Home”,
“StreetAddress1”: “1076 SoulBeats Lane”,
“StreetAddress2”: “Apt #97”,
“StreetAddress3”: “string”,
“StreetAddress4”: “string”,
“City”: “Jamaical”,
“StateCode”: “CA”,
“PostalCode”: “94549”,
“County”: “BlueMoutain”,
“Country”: “USA”
}
],
“Keys”: [
{
“KeyType”: “Secret”,
“KeyOwner”: “Anonomatic”,
“KeyValue”: “bU04XHfENraRXDt0P3CkZhwAOQ55vteV”
}
],
“SourceSystemName”: “Anonomatic”,
“SubSourceSystemName”: “PolyIdTest”
},
{
“Index”: 6,
“SourceSystemKey”: “0964734022854722”,
“FirstName”: “Robert”,
“MiddleName”: “Musicality”,
“LastName”: “Malarkey”,
“OrgName”: “IslandBuoys”,
“DateOfBirth”: “2021-03-29T22:32:25.918Z”,
“Gender”: “M”,
“IsForgotten”: 0,
“Emails”: [
{
“EmailAddress”: “somewhere@rainbow.ky”
}
],
“Phones”: [
{
“PhoneType”: “Mobile”,
“PhoneOwner”: “XFinity”,
“PhoneNumber”: “415.123.5813”
}
],
“Addresses”: [
{
“AddressType”: “Home”,
“StreetAddress1”: “1076 SoulBeats Lane”,
“StreetAddress2”: “Apt #97”,
“StreetAddress3”: “string”,
“StreetAddress4”: “string”,
“City”: “Jamaical”,
“StateCode”: “CA”,
“PostalCode”: “94549”,
“County”: “BlueMoutain”,
“Country”: “USA”
}
],
“Keys”: [
{
“KeyType”: “Secret”,
“KeyOwner”: “Anonomatic”,
“KeyValue”: “bU04XHfENraRXDt0P3CkZhwAOQ55vteV”
}
],
“SourceSystemName”: “Anonomatic”,
“SubSourceSystemName”: “PolyIdTest”
},
{
“Index”: 7,
“SourceSystemKey”: “0273877675861697”,
“FirstName”: “Robert”,
“MiddleName”: “Musicality”,
“LastName”: “Malarkey”,
“OrgName”: “IslandBuoys”,
“DateOfBirth”: “2021-03-29T22:32:25.918Z”,
“Gender”: “M”,
“IsForgotten”: 0,
“Emails”: [
{
“EmailAddress”: “somewhere@rainbow.ky”
}
],
“Phones”: [
{
“PhoneType”: “Mobile”,
“PhoneOwner”: “XFinity”,
“PhoneNumber”: “415.123.5813”
}
],
“Addresses”: [
{
“AddressType”: “Home”,
“StreetAddress1”: “1076 SoulBeats Lane”,
“StreetAddress2”: “Apt #97”,
“StreetAddress3”: “string”,
“StreetAddress4”: “string”,
“City”: “Jamaical”,
“StateCode”: “CA”,
“PostalCode”: “94549”,
“County”: “BlueMoutain”,
“Country”: “USA”
}
],
“Keys”: [
{
“KeyType”: “Secret”,
“KeyOwner”: “Anonomatic”,
“KeyValue”: “bU04XHfENraRXDt0P3CkZhwAOQ55vteV”
}
],
“SourceSystemName”: “Anonomatic”,
“SubSourceSystemName”: “PolyIdTest”
}
]
}
Delete Profile (File: test-delete-profile.json)
(Same as ForgetProfile)
{“SourceSystemKey”: “1741204973776210”}
Can send either SourceSystemKey or PolyId
Forget Profile (File: test-forget-profile.json)
(Same as Delete Profile)
{“SourceSystemKey”: “1741204973776210”}
Can send either SourceSystemKey or PolyId