Upsert a user
curl --request PUT \
--url https://platform.dev.timeback.com/rostering/1.0/users/{sourcedId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user": {
"sourcedId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"givenName": "<string>",
"familyName": "<string>",
"primaryOrg": {
"sourcedId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "org",
"href": "<string>"
},
"email": "jsmith@example.com",
"grades": [
"<string>"
],
"metadata": {},
"userMasterIdentifier": "<string>",
"username": "<string>",
"userIds": [
{
"type": "<string>",
"identifier": "<string>"
}
],
"middleName": "<string>",
"preferredFirstName": "<string>",
"preferredMiddleName": "<string>",
"preferredLastName": "<string>",
"pronouns": "<string>",
"demographics": {
"birthDate": "2023-12-25"
},
"identifier": "<string>",
"sms": "<string>",
"phone": "<string>",
"password": "<string>",
"roles": [
{
"org": {
"sourcedId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "org",
"href": "<string>"
}
}
]
}
}
'import requests
url = "https://platform.dev.timeback.com/rostering/1.0/users/{sourcedId}"
payload = { "user": {
"sourcedId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"givenName": "<string>",
"familyName": "<string>",
"primaryOrg": {
"sourcedId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "org",
"href": "<string>"
},
"email": "jsmith@example.com",
"grades": ["<string>"],
"metadata": {},
"userMasterIdentifier": "<string>",
"username": "<string>",
"userIds": [
{
"type": "<string>",
"identifier": "<string>"
}
],
"middleName": "<string>",
"preferredFirstName": "<string>",
"preferredMiddleName": "<string>",
"preferredLastName": "<string>",
"pronouns": "<string>",
"demographics": { "birthDate": "2023-12-25" },
"identifier": "<string>",
"sms": "<string>",
"phone": "<string>",
"password": "<string>",
"roles": [{ "org": {
"sourcedId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "org",
"href": "<string>"
} }]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user: {
sourcedId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
givenName: '<string>',
familyName: '<string>',
primaryOrg: {
sourcedId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: 'org',
href: '<string>'
},
email: 'jsmith@example.com',
grades: ['<string>'],
metadata: {},
userMasterIdentifier: '<string>',
username: '<string>',
userIds: [{type: '<string>', identifier: '<string>'}],
middleName: '<string>',
preferredFirstName: '<string>',
preferredMiddleName: '<string>',
preferredLastName: '<string>',
pronouns: '<string>',
demographics: {birthDate: '2023-12-25'},
identifier: '<string>',
sms: '<string>',
phone: '<string>',
password: '<string>',
roles: [
{
org: {
sourcedId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: 'org',
href: '<string>'
}
}
]
}
})
};
fetch('https://platform.dev.timeback.com/rostering/1.0/users/{sourcedId}', 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://platform.dev.timeback.com/rostering/1.0/users/{sourcedId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'user' => [
'sourcedId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'givenName' => '<string>',
'familyName' => '<string>',
'primaryOrg' => [
'sourcedId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => 'org',
'href' => '<string>'
],
'email' => 'jsmith@example.com',
'grades' => [
'<string>'
],
'metadata' => [
],
'userMasterIdentifier' => '<string>',
'username' => '<string>',
'userIds' => [
[
'type' => '<string>',
'identifier' => '<string>'
]
],
'middleName' => '<string>',
'preferredFirstName' => '<string>',
'preferredMiddleName' => '<string>',
'preferredLastName' => '<string>',
'pronouns' => '<string>',
'demographics' => [
'birthDate' => '2023-12-25'
],
'identifier' => '<string>',
'sms' => '<string>',
'phone' => '<string>',
'password' => '<string>',
'roles' => [
[
'org' => [
'sourcedId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => 'org',
'href' => '<string>'
]
]
]
]
]),
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://platform.dev.timeback.com/rostering/1.0/users/{sourcedId}"
payload := strings.NewReader("{\n \"user\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"primaryOrg\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"org\",\n \"href\": \"<string>\"\n },\n \"email\": \"jsmith@example.com\",\n \"grades\": [\n \"<string>\"\n ],\n \"metadata\": {},\n \"userMasterIdentifier\": \"<string>\",\n \"username\": \"<string>\",\n \"userIds\": [\n {\n \"type\": \"<string>\",\n \"identifier\": \"<string>\"\n }\n ],\n \"middleName\": \"<string>\",\n \"preferredFirstName\": \"<string>\",\n \"preferredMiddleName\": \"<string>\",\n \"preferredLastName\": \"<string>\",\n \"pronouns\": \"<string>\",\n \"demographics\": {\n \"birthDate\": \"2023-12-25\"\n },\n \"identifier\": \"<string>\",\n \"sms\": \"<string>\",\n \"phone\": \"<string>\",\n \"password\": \"<string>\",\n \"roles\": [\n {\n \"org\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"org\",\n \"href\": \"<string>\"\n }\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://platform.dev.timeback.com/rostering/1.0/users/{sourcedId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"primaryOrg\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"org\",\n \"href\": \"<string>\"\n },\n \"email\": \"jsmith@example.com\",\n \"grades\": [\n \"<string>\"\n ],\n \"metadata\": {},\n \"userMasterIdentifier\": \"<string>\",\n \"username\": \"<string>\",\n \"userIds\": [\n {\n \"type\": \"<string>\",\n \"identifier\": \"<string>\"\n }\n ],\n \"middleName\": \"<string>\",\n \"preferredFirstName\": \"<string>\",\n \"preferredMiddleName\": \"<string>\",\n \"preferredLastName\": \"<string>\",\n \"pronouns\": \"<string>\",\n \"demographics\": {\n \"birthDate\": \"2023-12-25\"\n },\n \"identifier\": \"<string>\",\n \"sms\": \"<string>\",\n \"phone\": \"<string>\",\n \"password\": \"<string>\",\n \"roles\": [\n {\n \"org\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"org\",\n \"href\": \"<string>\"\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.dev.timeback.com/rostering/1.0/users/{sourcedId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"primaryOrg\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"org\",\n \"href\": \"<string>\"\n },\n \"email\": \"jsmith@example.com\",\n \"grades\": [\n \"<string>\"\n ],\n \"metadata\": {},\n \"userMasterIdentifier\": \"<string>\",\n \"username\": \"<string>\",\n \"userIds\": [\n {\n \"type\": \"<string>\",\n \"identifier\": \"<string>\"\n }\n ],\n \"middleName\": \"<string>\",\n \"preferredFirstName\": \"<string>\",\n \"preferredMiddleName\": \"<string>\",\n \"preferredLastName\": \"<string>\",\n \"pronouns\": \"<string>\",\n \"demographics\": {\n \"birthDate\": \"2023-12-25\"\n },\n \"identifier\": \"<string>\",\n \"sms\": \"<string>\",\n \"phone\": \"<string>\",\n \"password\": \"<string>\",\n \"roles\": [\n {\n \"org\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"org\",\n \"href\": \"<string>\"\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_bodyUsers
Upsert a user
Creates or updates a user by their sourcedId
PUT
/
rostering
/
1.0
/
users
/
{sourcedId}
Upsert a user
curl --request PUT \
--url https://platform.dev.timeback.com/rostering/1.0/users/{sourcedId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user": {
"sourcedId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"givenName": "<string>",
"familyName": "<string>",
"primaryOrg": {
"sourcedId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "org",
"href": "<string>"
},
"email": "jsmith@example.com",
"grades": [
"<string>"
],
"metadata": {},
"userMasterIdentifier": "<string>",
"username": "<string>",
"userIds": [
{
"type": "<string>",
"identifier": "<string>"
}
],
"middleName": "<string>",
"preferredFirstName": "<string>",
"preferredMiddleName": "<string>",
"preferredLastName": "<string>",
"pronouns": "<string>",
"demographics": {
"birthDate": "2023-12-25"
},
"identifier": "<string>",
"sms": "<string>",
"phone": "<string>",
"password": "<string>",
"roles": [
{
"org": {
"sourcedId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "org",
"href": "<string>"
}
}
]
}
}
'import requests
url = "https://platform.dev.timeback.com/rostering/1.0/users/{sourcedId}"
payload = { "user": {
"sourcedId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"givenName": "<string>",
"familyName": "<string>",
"primaryOrg": {
"sourcedId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "org",
"href": "<string>"
},
"email": "jsmith@example.com",
"grades": ["<string>"],
"metadata": {},
"userMasterIdentifier": "<string>",
"username": "<string>",
"userIds": [
{
"type": "<string>",
"identifier": "<string>"
}
],
"middleName": "<string>",
"preferredFirstName": "<string>",
"preferredMiddleName": "<string>",
"preferredLastName": "<string>",
"pronouns": "<string>",
"demographics": { "birthDate": "2023-12-25" },
"identifier": "<string>",
"sms": "<string>",
"phone": "<string>",
"password": "<string>",
"roles": [{ "org": {
"sourcedId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "org",
"href": "<string>"
} }]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user: {
sourcedId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
givenName: '<string>',
familyName: '<string>',
primaryOrg: {
sourcedId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: 'org',
href: '<string>'
},
email: 'jsmith@example.com',
grades: ['<string>'],
metadata: {},
userMasterIdentifier: '<string>',
username: '<string>',
userIds: [{type: '<string>', identifier: '<string>'}],
middleName: '<string>',
preferredFirstName: '<string>',
preferredMiddleName: '<string>',
preferredLastName: '<string>',
pronouns: '<string>',
demographics: {birthDate: '2023-12-25'},
identifier: '<string>',
sms: '<string>',
phone: '<string>',
password: '<string>',
roles: [
{
org: {
sourcedId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: 'org',
href: '<string>'
}
}
]
}
})
};
fetch('https://platform.dev.timeback.com/rostering/1.0/users/{sourcedId}', 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://platform.dev.timeback.com/rostering/1.0/users/{sourcedId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'user' => [
'sourcedId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'givenName' => '<string>',
'familyName' => '<string>',
'primaryOrg' => [
'sourcedId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => 'org',
'href' => '<string>'
],
'email' => 'jsmith@example.com',
'grades' => [
'<string>'
],
'metadata' => [
],
'userMasterIdentifier' => '<string>',
'username' => '<string>',
'userIds' => [
[
'type' => '<string>',
'identifier' => '<string>'
]
],
'middleName' => '<string>',
'preferredFirstName' => '<string>',
'preferredMiddleName' => '<string>',
'preferredLastName' => '<string>',
'pronouns' => '<string>',
'demographics' => [
'birthDate' => '2023-12-25'
],
'identifier' => '<string>',
'sms' => '<string>',
'phone' => '<string>',
'password' => '<string>',
'roles' => [
[
'org' => [
'sourcedId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => 'org',
'href' => '<string>'
]
]
]
]
]),
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://platform.dev.timeback.com/rostering/1.0/users/{sourcedId}"
payload := strings.NewReader("{\n \"user\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"primaryOrg\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"org\",\n \"href\": \"<string>\"\n },\n \"email\": \"jsmith@example.com\",\n \"grades\": [\n \"<string>\"\n ],\n \"metadata\": {},\n \"userMasterIdentifier\": \"<string>\",\n \"username\": \"<string>\",\n \"userIds\": [\n {\n \"type\": \"<string>\",\n \"identifier\": \"<string>\"\n }\n ],\n \"middleName\": \"<string>\",\n \"preferredFirstName\": \"<string>\",\n \"preferredMiddleName\": \"<string>\",\n \"preferredLastName\": \"<string>\",\n \"pronouns\": \"<string>\",\n \"demographics\": {\n \"birthDate\": \"2023-12-25\"\n },\n \"identifier\": \"<string>\",\n \"sms\": \"<string>\",\n \"phone\": \"<string>\",\n \"password\": \"<string>\",\n \"roles\": [\n {\n \"org\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"org\",\n \"href\": \"<string>\"\n }\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://platform.dev.timeback.com/rostering/1.0/users/{sourcedId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"primaryOrg\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"org\",\n \"href\": \"<string>\"\n },\n \"email\": \"jsmith@example.com\",\n \"grades\": [\n \"<string>\"\n ],\n \"metadata\": {},\n \"userMasterIdentifier\": \"<string>\",\n \"username\": \"<string>\",\n \"userIds\": [\n {\n \"type\": \"<string>\",\n \"identifier\": \"<string>\"\n }\n ],\n \"middleName\": \"<string>\",\n \"preferredFirstName\": \"<string>\",\n \"preferredMiddleName\": \"<string>\",\n \"preferredLastName\": \"<string>\",\n \"pronouns\": \"<string>\",\n \"demographics\": {\n \"birthDate\": \"2023-12-25\"\n },\n \"identifier\": \"<string>\",\n \"sms\": \"<string>\",\n \"phone\": \"<string>\",\n \"password\": \"<string>\",\n \"roles\": [\n {\n \"org\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"org\",\n \"href\": \"<string>\"\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.dev.timeback.com/rostering/1.0/users/{sourcedId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"primaryOrg\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"org\",\n \"href\": \"<string>\"\n },\n \"email\": \"jsmith@example.com\",\n \"grades\": [\n \"<string>\"\n ],\n \"metadata\": {},\n \"userMasterIdentifier\": \"<string>\",\n \"username\": \"<string>\",\n \"userIds\": [\n {\n \"type\": \"<string>\",\n \"identifier\": \"<string>\"\n }\n ],\n \"middleName\": \"<string>\",\n \"preferredFirstName\": \"<string>\",\n \"preferredMiddleName\": \"<string>\",\n \"preferredLastName\": \"<string>\",\n \"pronouns\": \"<string>\",\n \"demographics\": {\n \"birthDate\": \"2023-12-25\"\n },\n \"identifier\": \"<string>\",\n \"sms\": \"<string>\",\n \"phone\": \"<string>\",\n \"password\": \"<string>\",\n \"roles\": [\n {\n \"org\": {\n \"sourcedId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"org\",\n \"href\": \"<string>\"\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
OAuth 2.0 client credentials flow. Contact timeback@trilogy.com to request credentials for your application.
Path Parameters
User ID
Body
application/json
User object to be created or updated
User information to be created or updated
Show child attributes
Show child attributes
Response
Successfully created or updated
⌘I