Map v2 IDs to v3 IDs
curl --request GET \
--url https://production.hifi.com/v3/id-mappings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
{
"v2Id": "8f14e45f-ceea-467e-adde-0f8d0f5f4b1c",
"resourceType": "USER"
}
]
}
'import requests
url = "https://production.hifi.com/v3/id-mappings"
payload = { "ids": [
{
"v2Id": "8f14e45f-ceea-467e-adde-0f8d0f5f4b1c",
"resourceType": "USER"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: [{v2Id: '8f14e45f-ceea-467e-adde-0f8d0f5f4b1c', resourceType: 'USER'}]})
};
fetch('https://production.hifi.com/v3/id-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://production.hifi.com/v3/id-mappings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
[
'v2Id' => '8f14e45f-ceea-467e-adde-0f8d0f5f4b1c',
'resourceType' => 'USER'
]
]
]),
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://production.hifi.com/v3/id-mappings"
payload := strings.NewReader("{\n \"ids\": [\n {\n \"v2Id\": \"8f14e45f-ceea-467e-adde-0f8d0f5f4b1c\",\n \"resourceType\": \"USER\"\n }\n ]\n}")
req, _ := http.NewRequest("GET", 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.get("https://production.hifi.com/v3/id-mappings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n {\n \"v2Id\": \"8f14e45f-ceea-467e-adde-0f8d0f5f4b1c\",\n \"resourceType\": \"USER\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.hifi.com/v3/id-mappings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n {\n \"v2Id\": \"8f14e45f-ceea-467e-adde-0f8d0f5f4b1c\",\n \"resourceType\": \"USER\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ids": [
{
"resourceType": "USER",
"v2Id": "8f14e45f-ceea-467e-adde-0f8d0f5f4b1c",
"v3Id": "usr_3Kf9dQ2mNpXwZ7bV1aLcs",
"mapped": true
}
]
}{
"type": "VALIDATION_ERROR",
"message": "One or more fields are invalid or missing.",
"fields": [
{
"code": "invalid_value",
"message": "Must be a valid email address",
"field": "email"
}
]
}{
"type": "UNAUTHORIZED",
"message": "Authentication required"
}{
"type": "INTERNAL_SERVER_ERROR",
"message": "An internal server error occurred"
}Migration
Map v2 IDs to v3 IDs
Resolve up to 1000 v2 resource UUIDs to their corresponding v3 public IDs.
Entries that cannot be resolved (unknown ID, or a resourceType without a
migration mapping) are returned with v3Id: null and mapped: false
rather than causing the whole request to fail.
This is a GET request with a JSON request body; ensure your HTTP client
and any intermediate proxies are configured to send a body with GET.
GET
/
v3
/
id-mappings
Map v2 IDs to v3 IDs
curl --request GET \
--url https://production.hifi.com/v3/id-mappings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
{
"v2Id": "8f14e45f-ceea-467e-adde-0f8d0f5f4b1c",
"resourceType": "USER"
}
]
}
'import requests
url = "https://production.hifi.com/v3/id-mappings"
payload = { "ids": [
{
"v2Id": "8f14e45f-ceea-467e-adde-0f8d0f5f4b1c",
"resourceType": "USER"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: [{v2Id: '8f14e45f-ceea-467e-adde-0f8d0f5f4b1c', resourceType: 'USER'}]})
};
fetch('https://production.hifi.com/v3/id-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://production.hifi.com/v3/id-mappings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
[
'v2Id' => '8f14e45f-ceea-467e-adde-0f8d0f5f4b1c',
'resourceType' => 'USER'
]
]
]),
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://production.hifi.com/v3/id-mappings"
payload := strings.NewReader("{\n \"ids\": [\n {\n \"v2Id\": \"8f14e45f-ceea-467e-adde-0f8d0f5f4b1c\",\n \"resourceType\": \"USER\"\n }\n ]\n}")
req, _ := http.NewRequest("GET", 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.get("https://production.hifi.com/v3/id-mappings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n {\n \"v2Id\": \"8f14e45f-ceea-467e-adde-0f8d0f5f4b1c\",\n \"resourceType\": \"USER\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.hifi.com/v3/id-mappings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n {\n \"v2Id\": \"8f14e45f-ceea-467e-adde-0f8d0f5f4b1c\",\n \"resourceType\": \"USER\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ids": [
{
"resourceType": "USER",
"v2Id": "8f14e45f-ceea-467e-adde-0f8d0f5f4b1c",
"v3Id": "usr_3Kf9dQ2mNpXwZ7bV1aLcs",
"mapped": true
}
]
}{
"type": "VALIDATION_ERROR",
"message": "One or more fields are invalid or missing.",
"fields": [
{
"code": "invalid_value",
"message": "Must be a valid email address",
"field": "email"
}
]
}{
"type": "UNAUTHORIZED",
"message": "Authentication required"
}{
"type": "INTERNAL_SERVER_ERROR",
"message": "An internal server error occurred"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
v2 IDs to resolve to their v3 public IDs.
Up to 1000 v2 IDs to resolve to their v3 public IDs.
Required array length:
1 - 1000 elementsShow child attributes
Show child attributes
Response
v2-to-v3 ID mapping results, in the same order as the request.
Show child attributes
Show child attributes
⌘I