APIs
...
Representatives
Create a representative
code examples curl location 'https //profile backend detected app/api/v2/public/representatives' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data raw '{ "name" { "first name" "jon", "last name" "doe" }, "email" "example\@email com", "profile id" "0192 0ol1p 1299al 122", "types" \[] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "name" { "first name" "jon", "last name" "doe" }, "email" "example\@email com", "profile id" "0192 0ol1p 1299al 122", "types" \[] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //profile backend detected app/api/v2/public/representatives", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //profile backend detected app/api/v2/public/representatives") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "name" { "first name" "jon", "last name" "doe" }, "email" "example\@email com", "profile id" "0192 0ol1p 1299al 122", "types" \[] }) response = https request(request) puts response read body import requests import json url = "https //profile backend detected app/api/v2/public/representatives" payload = json dumps({ "name" { "first name" "jon", "last name" "doe" }, "email" "example\@email com", "profile id" "0192 0ol1p 1299al 122", "types" \[] }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // created { "data" { "id" "4d532245 1ce2 4963 a61d 38b6163aed87", "profile id" "4d532245 1ce2 4963 a61d 38b6163aed87", "customer reference" "my unique code", "is company" false, "types" \[ "" ], "full name" "jon doe", "professional profile" "https //professional website com", "country" "united kingdom of great britain and northern ireland", "country code" "gb", "country of residence" "united kingdom of great britain and northern ireland", "residence country code" "gb", "personal number" "+44071827199120", "first name" "andre", "last name" "ferraz", "dob" "10/01/2000", "email" "example\@email com", "job title" "engineer", "apartment number" "43", "address 1" "1 main st", "address 2" "", "city" "london", "state" "california", "post code" "ec1 9a0", "country of birth" "united states of america", "birth country code" "us", "nationality" "british", "person type details" { "appointment date" "2023 04 27 09 57 53", "majority" true, "governing" true, "responsibility" false, "majority percentage" "25", "specific ownership percentage" "39" }, "copy address" false, "updated at" "2023 04 27 09 57 53", "created at" "2023 04 27 09 57 53" } }// unauthorized { "message" "unauthenticated " }// unprocessable content { "message" "the example field code is required ", "example field" \[ "the example field has already been taken " ] }// too many requests { "message" "too many attempts " }