Referrals
Pureprofile has functionality to refer your friends for the panel. This will send emails to your friends to join the panel. The number of emails that can be referred at once are set during the panel setup. If you exceed the maximum limit you will get an error.
Refer friends
When using this endpoint a list of emails can be submitted. Pureprofile will automatically email to your friends to join the panel. Below is a sample:
- cURL
- Node
- Python
- Go
curl --location --request POST 'https://api.sandbox.pureprofile.io/v1/panel/refer-friends' \--header 'Accept: application/json' \--header 'Authorization: Bearer <access_token>'--data-raw '{ "emails": [ "<email1>", "<email2>" ]}'
var axios = require("axios");var data = JSON.stringify({ emails: ["<email1>", "<email2>"],});var config = { method: "post", url: "https://api.sandbox.pureprofile.io/v1/panel/refer-friends", headers: { Accept: "application/json", Authorization: "Bearer <access_token>", }, data: data,};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/refer-friends"payload = json.dumps({ "emails": [ "<email1>", "<email2>" ]})headers = { 'Accept': 'application/json', 'Authorization': 'Bearer <access_token>'}response = requests.request("POST", 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/refer-friends" method := "POST" payload := strings.NewReader(`{ "emails": [ "<email1>", "<email2>" ] }`) client := &http.Client {} req, err := http.NewRequest(method, url, payload) 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 the invited and failed count as well as the emails that were successfull and the ones that failed. Below is a sample:
{ "message": "success", "data": { "invited_count": 1, "invited": ["<email1>"], "failed_count": 1, "failed": ["<email2>"] }}