Accounts
Accounts endpoints are used to, fetch account details, fetch profiling information and close a panelist account.
Fetch account details
An example for getting basic details of the panelist's account is shown below:
- cURL
- Node
- Python
- Go
curl --location --request GET 'https://api.sandbox.pureprofile.io/v1/panel/account' \--header 'Accept: application/json' \--header 'Authorization: Bearer <access_token>'
var axios = require("axios");var config = { method: "get", url: "https://api.sandbox.pureprofile.io/v1/panel/account", headers: { Accept: "application/json", Authorization: "Bearer <acess_token>", },};axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });
import requestsurl = "https://api.sandbox.pureprofile.io/v1/panel/account"payload={}headers = { 'Accept': 'application/json', 'Authorization': 'Bearer <acess_token>'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)
package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://api.sandbox.pureprofile.io/v1/panel/account" method := "GET" client := &http.Client {} req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) return } req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Bearer <access_token>") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body))}
The response contains information regarding the account of the panelist:
{ "message": "success", "data": { "profile": { "BIRTH_DATE": "1972-12-25", "COMPLETED_COUNT": 0, "CREATED_DATE": "2022-06-23", "DUPLICATE_COUNT": 0, "EMAIL": "9d9032bf-205b-44a2-ab00-ae8d0b77f7fa_chris.sylaios@gmail.com", "EMAIL_CONFIRMED": "Yes", "EMAIL_VALID": "Yes", "FIRST_NAME": "Chris", "INVITED_COUNT": 0, "LAST_NAME": "Sylaios", "LOCALE": "ENG-AU", "OPENED_COUNT": 0, "POINTS_BALANCE": 0, "POINTS_REDEEMED": 0, "POINTS_REWARDED": 0, "PROFILE_COUNT": 0, "QUALITY_COUNT": 0, "QUOTA_COUNT": 0, "RECRUITMENT_SOURCE": 1, "REMINDED_COUNT": 0, "RESPONSE_RATE": 0, "SECURITY_COUNT": 0, "STARTED_COUNT": 0, "SUBSCRIBED_DATE": "2022-06-23" }, "activity": [ { "type": "AccountTransfer", "status": "completed", "created_at": "2022-06-23T17:58:16", "transaction_id": null, "transaction_type": null, "id": null, "reward": null, "security_flags": [] } ], "devices": [] }}
Fetch account data
This endpoint is used to get panelists collected data. Bellow is a sample:
- cURL
- Node
- Python
- Go
curl --location --request GET 'https://api.sandbox.pureprofile.io/v1/panel/account/data' \--header 'Accept: application/json' \--header 'Authorization: Bearer <access_token>'
var axios = require("axios");var config = { method: "get", url: "https://api.sandbox.pureprofile.io/v1/panel/account/data", headers: { Accept: "application/json", Authorization: "Bearer <access_token>", },};axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });
import requestsurl = "https://api.sandbox.pureprofile.io/v1/panel/account/data"payload={}headers = { 'Accept': 'application/json', 'Authorization': 'Bearer <access_token>'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)
package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://api.sandbox.pureprofile.io/v1/panel/account/data" method := "GET" client := &http.Client {} req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) return } req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Bearer <access_token>") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body))}
The response contains information regarding the account of the panelist:
{ "message": "success", "data": { "profile": { "BIRTH_DATE": "1972-12-25", "COMPLETED_COUNT": 0, "CREATED_DATE": "2022-06-23", "DUPLICATE_COUNT": 0, "EMAIL": "9d9032bf-205b-44a2-ab00-ae8d0b77f7fa_chris.sylaios@gmail.com", "EMAIL_CONFIRMED": "Yes", "EMAIL_VALID": "Yes", "FIRST_NAME": "Chris", "INVITED_COUNT": 0, "LAST_NAME": "Sylaios", "LOCALE": "ENG-AU", "OPENED_COUNT": 0, "POINTS_BALANCE": 0, "POINTS_REDEEMED": 0, "POINTS_REWARDED": 0, "PROFILE_COUNT": 0, "QUALITY_COUNT": 0, "QUOTA_COUNT": 0, "RECRUITMENT_SOURCE": 1, "REMINDED_COUNT": 0, "RESPONSE_RATE": 0, "SECURITY_COUNT": 0, "STARTED_COUNT": 0, "SUBSCRIBED_DATE": "2022-06-23" }, "activity": [ { "type": "AccountTransfer", "status": "completed", "created_at": "2022-06-23T17:58:16", "transaction_id": null, "transaction_type": null, "id": null, "reward": null, "security_flags": [] } ], "devices": [] }}
Closing panelist accounts
Closing an account will basically delete the panelist from Pureprofile. We will do GDPR compliant data wipe on users account while saving activity / reward / redemption history for analytics. Below is a sample for closing an account:
- cURL
- Node
- Python
- Go
curl --location --request DELETE 'https://api.sandbox.pureprofile.io/v1/panel/account' \--header 'Accept: application/json' \--header 'Authorization: Bearer <access_token>'
var axios = require("axios");var config = { method: "delete", url: "https://api.sandbox.pureprofile.io/v1/panel/account", headers: { Accept: "application/json", Authorization: "Bearer <access_token>", },};axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });
import requestsurl = "https://api.sandbox.pureprofile.io/v1/panel/account"payload={}headers = { 'Accept': 'application/json', 'Authorization': 'Bearer <access_token>'}response = requests.request("DELETE", url, headers=headers, data=payload)print(response.text)
package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://api.sandbox.pureprofile.io/v1/panel/account" method := "DELETE" client := &http.Client {} req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) return } req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Bearer <access_token>") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body))}
Closing an account will return a success message:
{ "message": "success"}