Authenticating panelists
Pureprofile APIs allows the authentication of existing panelists. This allows for password-less authentication directly
using the access_token
and the user identifier used to initially register the panelist.
Read the following sections for more detail.
Authenticate a panelist
In order to authenticate a new panelist you must provide the unique id (email, uuid, etc) that was used during the registration of the panelist.
The system will crete an access_token
that can be used to access the Panel API. Below is a sample for authenticating
and existing panelist:
- cURL
- Node
- Python
- Go
curl --location --request POST 'https://api.sandbox.pureprofile.io/v1/partner/panel/authenticate' \--header 'Content-Type: application/json' \--header 'Accept: application/json' \--header 'Authorization: Basic <credentials>'--data-raw '{ "user": "<user>" "panel": "<panel>"}'
var axios = require("axios");var data = JSON.stringify({ user: "<user>", panel: "<panel>",});var config = { method: "post", url: "https://api.sandbox.pureprofile.io/v1/partner/panel/authenticate", headers: { "Content-Type": "application/json", Accept: "application/json", Authorization: "Basic <credentials>", }, data: data,};axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });
import requestsimport jsonurl = "https://api.sandbox.pureprofile.io/v1/partner/panel/authenticate"payload = json.dumps({ "user": "<user>" "panel": "<panel>"})headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': 'Basic <credentials>'}response = requests.request("POST", url, headers=headers, data=payload)print(response.text)
package mainimport ( "fmt" "strings" "net/http" "io/ioutil")func main() { url := "https://api.sandbox.pureprofile.io/v1/partner/panel/authenticate" method := "POST" payload := strings.NewReader(`{ "user": "<user>" "panel": "<panel>" }`) client := &http.Client {} req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Content-Type", "application/json") req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Basic <credentials>") 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 of this API contains an access_token
that can be used to access all Panel API endpoints:
{ "access_token": "<access_token>", "expires_in": 3600, "token_type": "Bearer"}