User Sync
curl --request POST \
--url https://api.wazper.com/v1/user-sync \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"user": {
"email": "jsmith@example.com",
"country": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"name": "<string>",
"jobTitle": "<string>",
"inviteLink": "<string>"
}
}
'import requests
url = "https://api.wazper.com/v1/user-sync"
payload = { "user": {
"email": "jsmith@example.com",
"country": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"name": "<string>",
"jobTitle": "<string>",
"inviteLink": "<string>"
} }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user: {
email: 'jsmith@example.com',
country: '<string>',
firstName: '<string>',
lastName: '<string>',
name: '<string>',
jobTitle: '<string>',
inviteLink: '<string>'
}
})
};
fetch('https://api.wazper.com/v1/user-sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wazper.com/v1/user-sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user' => [
'email' => 'jsmith@example.com',
'country' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'name' => '<string>',
'jobTitle' => '<string>',
'inviteLink' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wazper.com/v1/user-sync"
payload := strings.NewReader("{\n \"user\": {\n \"email\": \"jsmith@example.com\",\n \"country\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"jobTitle\": \"<string>\",\n \"inviteLink\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wazper.com/v1/user-sync")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user\": {\n \"email\": \"jsmith@example.com\",\n \"country\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"jobTitle\": \"<string>\",\n \"inviteLink\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wazper.com/v1/user-sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user\": {\n \"email\": \"jsmith@example.com\",\n \"country\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"jobTitle\": \"<string>\",\n \"inviteLink\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status": "processing",
"requestId": "<string>",
"userId": "<string>",
"message": "Request accepted and is being processed asynchronously."
}Endpoints
User Sync API
API for synchronizing user data.
POST
/
v1
/
user-sync
User Sync
curl --request POST \
--url https://api.wazper.com/v1/user-sync \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"user": {
"email": "jsmith@example.com",
"country": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"name": "<string>",
"jobTitle": "<string>",
"inviteLink": "<string>"
}
}
'import requests
url = "https://api.wazper.com/v1/user-sync"
payload = { "user": {
"email": "jsmith@example.com",
"country": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"name": "<string>",
"jobTitle": "<string>",
"inviteLink": "<string>"
} }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user: {
email: 'jsmith@example.com',
country: '<string>',
firstName: '<string>',
lastName: '<string>',
name: '<string>',
jobTitle: '<string>',
inviteLink: '<string>'
}
})
};
fetch('https://api.wazper.com/v1/user-sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wazper.com/v1/user-sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user' => [
'email' => 'jsmith@example.com',
'country' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'name' => '<string>',
'jobTitle' => '<string>',
'inviteLink' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wazper.com/v1/user-sync"
payload := strings.NewReader("{\n \"user\": {\n \"email\": \"jsmith@example.com\",\n \"country\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"jobTitle\": \"<string>\",\n \"inviteLink\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wazper.com/v1/user-sync")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user\": {\n \"email\": \"jsmith@example.com\",\n \"country\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"jobTitle\": \"<string>\",\n \"inviteLink\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wazper.com/v1/user-sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user\": {\n \"email\": \"jsmith@example.com\",\n \"country\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"jobTitle\": \"<string>\",\n \"inviteLink\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status": "processing",
"requestId": "<string>",
"userId": "<string>",
"message": "Request accepted and is being processed asynchronously."
}POST /v1/user-sync
This endpoint is used to sync a user you have with the Wazper algorithm.
When it is called, it will run the Wazper algorithm to try to find the colleagues of that user.
Endpoint URL
The endpoint URL ishttps://api.wazper.com/v1/user-sync
HTTP Method
POST
Headers
| Header | Type | Required | Description |
|---|---|---|---|
X-API-Key | String | Yes | Your Wazper API Key. |
Content-Type | String | Yes | Must be application/json. |
Accept | String | No | Recommended application/json. |
Request Body
The request body must be a JSON object containing auser object.
{
"user": {
"email": "string",
"country": "string",
"firstName": "string (optional)",
"lastName": "string (optional)",
"name": "string (optional)",
"jobTitle": "string (optional)",
"inviteLink": "string (optional)"
}
}
| Field | Type | Required | Description |
|---|---|---|---|
email | String | Yes | The user’s email address. This is used as the primary identifier for creating or updating the user. |
country | String | Yes | The user’s country. This needs to be a country name, if you are using the API, you need to provide this Information accurately to get accurate results. |
firstName | String | No | The user’s first name. |
lastName | String | No | The user’s last name. |
name | String | No | The user’s full name. If firstName and lastName are provided, they will be concatenated if name is not. |
jobTitle | String | No | The user’s job title. |
inviteLink | String | No | A custom invite link for the user. If not provided, the client’s default invite link may be used. (in the case where you have an invitation link per user that can be used by his colleagues). |
Example Request (cURL)
curl -X POST 'https://api.wazper.com/v1/user-sync' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"user": {
"email": "john.doe@example.com",
"country": "US",
"firstName": "John",
"lastName": "Doe",
"jobTitle": "Software Engineer"
}
}'
Success Response (202 Accepted)
The response indicates that the request has been accepted for processing. The actual user synchronization and webhook trigger happen asynchronously.{
"success": true,
"status": "processing",
"requestId": "req_generated_id",
"userId": "user_generated_id",
"message": "Request accepted and is being processed asynchronously."
}
Error Responses
-
400 Bad Request - User Email Required:
{ "error": "User email is required" } -
400 Bad Request - User IP/Country Required:
{ "error": "User IP (country) is required" } -
400 Bad Request - API Key Not Linked:
{ "error": "API Key is not linked to a valid organization." } -
401 Unauthorized - API Key Required:
{ "error": "API Key is required" } -
401 Unauthorized - Invalid API Key:
{ "error": "Invalid API Key" } -
401 Unauthorized - Invalid Organization:
{ "error": "Invalid organization ID" } -
402 Payment Required - No Credits:
{ "error": "API Key has no remaining credits." } -
500 Internal Server Error:
{ "success": false, "error": "Internal server error", "details": "The error message from the server." }
Notes
- This API will run the Wazper algorithm to find the colleagues of the user.
- If the user has a personal email address (gmail, outlook, etc..) the algorithm will not run for him.
- You are only billed a credit when more than 1 colleague is found.
- You need to handle the
countryrecognition using the IP of the user for example and pass the name of the country to the API.
Authorizations
Body
application/json
Show child attributes
Show child attributes
Response
Request accepted for asynchronous processing.