Create IDP user attribute mapping
curl --request POST \
--url https://api.opal.dev/v1/apps/{app_id}/user-attribute-mappings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "managerEmail",
"use_as": "MANAGER_EMAIL"
}
'import requests
url = "https://api.opal.dev/v1/apps/{app_id}/user-attribute-mappings"
payload = {
"key": "managerEmail",
"use_as": "MANAGER_EMAIL"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: 'managerEmail', use_as: 'MANAGER_EMAIL'})
};
fetch('https://api.opal.dev/v1/apps/{app_id}/user-attribute-mappings', 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.opal.dev/v1/apps/{app_id}/user-attribute-mappings",
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([
'key' => 'managerEmail',
'use_as' => 'MANAGER_EMAIL'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.opal.dev/v1/apps/{app_id}/user-attribute-mappings"
payload := strings.NewReader("{\n \"key\": \"managerEmail\",\n \"use_as\": \"MANAGER_EMAIL\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.opal.dev/v1/apps/{app_id}/user-attribute-mappings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"managerEmail\",\n \"use_as\": \"MANAGER_EMAIL\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/apps/{app_id}/user-attribute-mappings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"managerEmail\",\n \"use_as\": \"MANAGER_EMAIL\"\n}"
response = http.request(request)
puts response.read_body{
"id": "1b978423-db0a-4037-a4cf-f79c60cb67b3",
"app_id": "32acc112-21ff-4669-91c2-21e27683eaa1",
"key": "managerEmail",
"use_as": "MANAGER_EMAIL"
}Create IDP user attribute mapping
Creates an IdpUserAttributeMapping for an identity provider or HRIS app.
Requires an admin token. The mapping takes effect on the app’s next sync.
POST
/
apps
/
{app_id}
/
user-attribute-mappings
Create IDP user attribute mapping
curl --request POST \
--url https://api.opal.dev/v1/apps/{app_id}/user-attribute-mappings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "managerEmail",
"use_as": "MANAGER_EMAIL"
}
'import requests
url = "https://api.opal.dev/v1/apps/{app_id}/user-attribute-mappings"
payload = {
"key": "managerEmail",
"use_as": "MANAGER_EMAIL"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: 'managerEmail', use_as: 'MANAGER_EMAIL'})
};
fetch('https://api.opal.dev/v1/apps/{app_id}/user-attribute-mappings', 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.opal.dev/v1/apps/{app_id}/user-attribute-mappings",
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([
'key' => 'managerEmail',
'use_as' => 'MANAGER_EMAIL'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.opal.dev/v1/apps/{app_id}/user-attribute-mappings"
payload := strings.NewReader("{\n \"key\": \"managerEmail\",\n \"use_as\": \"MANAGER_EMAIL\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.opal.dev/v1/apps/{app_id}/user-attribute-mappings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"managerEmail\",\n \"use_as\": \"MANAGER_EMAIL\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/apps/{app_id}/user-attribute-mappings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"managerEmail\",\n \"use_as\": \"MANAGER_EMAIL\"\n}"
response = http.request(request)
puts response.read_body{
"id": "1b978423-db0a-4037-a4cf-f79c60cb67b3",
"app_id": "32acc112-21ff-4669-91c2-21e27683eaa1",
"key": "managerEmail",
"use_as": "MANAGER_EMAIL"
}Authorizations
Body
application/json
Information needed to create an IdpUserAttributeMapping.
Response
The created user attribute mapping.
IdpUserAttributeMapping Object
Description
An attribute Opal imports from an identity provider or HRIS app, and the Opal
user field it is stored in. A CUSTOM mapping is imported as a user tag.
Was this page helpful?