updateUser
curl --request PUT \
--url 'https://sandbox.rollfi.xyz/adminPortal#updateUser' \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-msgpack' \
--data '{
"method": "updateUser",
"user": {
"userId": "5F45CFBA-4AED-41AF-B334-E02D23BA17AE",
"firstName": "Joe",
"lastName": "Bloggs",
"phoneNumber": "9889890989",
"email": "joeBloggs@mailsac.com",
"dateOfJoin": "2000-01-01",
"workerType": "W2",
"jobTitle": "Manager",
"companyLocationCategory": "Office",
"stateCode": "AL",
"companyLocationId": "9721384B-0367-41DD-BD64-EF8047E8FD71"
}
}'import requests
url = "https://sandbox.rollfi.xyz/adminPortal#updateUser"
payload = "{\n \"method\": \"updateUser\",\n \"user\": {\n \"userId\": \"5F45CFBA-4AED-41AF-B334-E02D23BA17AE\",\n \"firstName\": \"Joe\",\n \"lastName\": \"Bloggs\",\n \"phoneNumber\": \"9889890989\",\n \"email\": \"joeBloggs@mailsac.com\",\n \"dateOfJoin\": \"2000-01-01\",\n \"workerType\": \"W2\",\n \"jobTitle\": \"Manager\",\n \"companyLocationCategory\": \"Office\",\n \"stateCode\": \"AL\",\n \"companyLocationId\": \"9721384B-0367-41DD-BD64-EF8047E8FD71\"\n }\n}"
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-msgpack"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-msgpack'
},
body: '{\n "method": "updateUser",\n "user": {\n "userId": "5F45CFBA-4AED-41AF-B334-E02D23BA17AE",\n "firstName": "Joe",\n "lastName": "Bloggs",\n "phoneNumber": "9889890989",\n "email": "joeBloggs@mailsac.com",\n "dateOfJoin": "2000-01-01",\n "workerType": "W2",\n "jobTitle": "Manager",\n "companyLocationCategory": "Office",\n "stateCode": "AL",\n "companyLocationId": "9721384B-0367-41DD-BD64-EF8047E8FD71"\n }\n}'
};
fetch('https://sandbox.rollfi.xyz/adminPortal#updateUser', 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://sandbox.rollfi.xyz/adminPortal#updateUser",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "{\n \"method\": \"updateUser\",\n \"user\": {\n \"userId\": \"5F45CFBA-4AED-41AF-B334-E02D23BA17AE\",\n \"firstName\": \"Joe\",\n \"lastName\": \"Bloggs\",\n \"phoneNumber\": \"9889890989\",\n \"email\": \"joeBloggs@mailsac.com\",\n \"dateOfJoin\": \"2000-01-01\",\n \"workerType\": \"W2\",\n \"jobTitle\": \"Manager\",\n \"companyLocationCategory\": \"Office\",\n \"stateCode\": \"AL\",\n \"companyLocationId\": \"9721384B-0367-41DD-BD64-EF8047E8FD71\"\n }\n}",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/x-msgpack"
],
]);
$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://sandbox.rollfi.xyz/adminPortal#updateUser"
payload := strings.NewReader("{\n \"method\": \"updateUser\",\n \"user\": {\n \"userId\": \"5F45CFBA-4AED-41AF-B334-E02D23BA17AE\",\n \"firstName\": \"Joe\",\n \"lastName\": \"Bloggs\",\n \"phoneNumber\": \"9889890989\",\n \"email\": \"joeBloggs@mailsac.com\",\n \"dateOfJoin\": \"2000-01-01\",\n \"workerType\": \"W2\",\n \"jobTitle\": \"Manager\",\n \"companyLocationCategory\": \"Office\",\n \"stateCode\": \"AL\",\n \"companyLocationId\": \"9721384B-0367-41DD-BD64-EF8047E8FD71\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/x-msgpack")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://sandbox.rollfi.xyz/adminPortal#updateUser")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/x-msgpack")
.body("{\n \"method\": \"updateUser\",\n \"user\": {\n \"userId\": \"5F45CFBA-4AED-41AF-B334-E02D23BA17AE\",\n \"firstName\": \"Joe\",\n \"lastName\": \"Bloggs\",\n \"phoneNumber\": \"9889890989\",\n \"email\": \"joeBloggs@mailsac.com\",\n \"dateOfJoin\": \"2000-01-01\",\n \"workerType\": \"W2\",\n \"jobTitle\": \"Manager\",\n \"companyLocationCategory\": \"Office\",\n \"stateCode\": \"AL\",\n \"companyLocationId\": \"9721384B-0367-41DD-BD64-EF8047E8FD71\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.rollfi.xyz/adminPortal#updateUser")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/x-msgpack'
request.body = "{\n \"method\": \"updateUser\",\n \"user\": {\n \"userId\": \"5F45CFBA-4AED-41AF-B334-E02D23BA17AE\",\n \"firstName\": \"Joe\",\n \"lastName\": \"Bloggs\",\n \"phoneNumber\": \"9889890989\",\n \"email\": \"joeBloggs@mailsac.com\",\n \"dateOfJoin\": \"2000-01-01\",\n \"workerType\": \"W2\",\n \"jobTitle\": \"Manager\",\n \"companyLocationCategory\": \"Office\",\n \"stateCode\": \"AL\",\n \"companyLocationId\": \"9721384B-0367-41DD-BD64-EF8047E8FD71\"\n }\n}"
response = http.request(request)
puts response.read_body{
"user": {
"userId": "673F4A1C-ABD9-4E20-A235-66ED7CA71E8D",
"status": "Ready",
"message": "The User's data has been updated successfully."
}
}Admin Portal
updateUser
The updateUser API updates required employee information in the system.
What it does:
- Updates existing employee personal details and contact information
- Allows partial changes to user data
- StateCode can only be added for Remote workers, and companylocationId can only be added for “Office” workers
Note:
- We are not currently allowing changes to a user’s name for kyc (know your customer) purposes. Please contact support if a name change is required
PUT
/
adminPortal#updateUser
updateUser
curl --request PUT \
--url 'https://sandbox.rollfi.xyz/adminPortal#updateUser' \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-msgpack' \
--data '{
"method": "updateUser",
"user": {
"userId": "5F45CFBA-4AED-41AF-B334-E02D23BA17AE",
"firstName": "Joe",
"lastName": "Bloggs",
"phoneNumber": "9889890989",
"email": "joeBloggs@mailsac.com",
"dateOfJoin": "2000-01-01",
"workerType": "W2",
"jobTitle": "Manager",
"companyLocationCategory": "Office",
"stateCode": "AL",
"companyLocationId": "9721384B-0367-41DD-BD64-EF8047E8FD71"
}
}'import requests
url = "https://sandbox.rollfi.xyz/adminPortal#updateUser"
payload = "{\n \"method\": \"updateUser\",\n \"user\": {\n \"userId\": \"5F45CFBA-4AED-41AF-B334-E02D23BA17AE\",\n \"firstName\": \"Joe\",\n \"lastName\": \"Bloggs\",\n \"phoneNumber\": \"9889890989\",\n \"email\": \"joeBloggs@mailsac.com\",\n \"dateOfJoin\": \"2000-01-01\",\n \"workerType\": \"W2\",\n \"jobTitle\": \"Manager\",\n \"companyLocationCategory\": \"Office\",\n \"stateCode\": \"AL\",\n \"companyLocationId\": \"9721384B-0367-41DD-BD64-EF8047E8FD71\"\n }\n}"
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-msgpack"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-msgpack'
},
body: '{\n "method": "updateUser",\n "user": {\n "userId": "5F45CFBA-4AED-41AF-B334-E02D23BA17AE",\n "firstName": "Joe",\n "lastName": "Bloggs",\n "phoneNumber": "9889890989",\n "email": "joeBloggs@mailsac.com",\n "dateOfJoin": "2000-01-01",\n "workerType": "W2",\n "jobTitle": "Manager",\n "companyLocationCategory": "Office",\n "stateCode": "AL",\n "companyLocationId": "9721384B-0367-41DD-BD64-EF8047E8FD71"\n }\n}'
};
fetch('https://sandbox.rollfi.xyz/adminPortal#updateUser', 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://sandbox.rollfi.xyz/adminPortal#updateUser",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "{\n \"method\": \"updateUser\",\n \"user\": {\n \"userId\": \"5F45CFBA-4AED-41AF-B334-E02D23BA17AE\",\n \"firstName\": \"Joe\",\n \"lastName\": \"Bloggs\",\n \"phoneNumber\": \"9889890989\",\n \"email\": \"joeBloggs@mailsac.com\",\n \"dateOfJoin\": \"2000-01-01\",\n \"workerType\": \"W2\",\n \"jobTitle\": \"Manager\",\n \"companyLocationCategory\": \"Office\",\n \"stateCode\": \"AL\",\n \"companyLocationId\": \"9721384B-0367-41DD-BD64-EF8047E8FD71\"\n }\n}",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/x-msgpack"
],
]);
$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://sandbox.rollfi.xyz/adminPortal#updateUser"
payload := strings.NewReader("{\n \"method\": \"updateUser\",\n \"user\": {\n \"userId\": \"5F45CFBA-4AED-41AF-B334-E02D23BA17AE\",\n \"firstName\": \"Joe\",\n \"lastName\": \"Bloggs\",\n \"phoneNumber\": \"9889890989\",\n \"email\": \"joeBloggs@mailsac.com\",\n \"dateOfJoin\": \"2000-01-01\",\n \"workerType\": \"W2\",\n \"jobTitle\": \"Manager\",\n \"companyLocationCategory\": \"Office\",\n \"stateCode\": \"AL\",\n \"companyLocationId\": \"9721384B-0367-41DD-BD64-EF8047E8FD71\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/x-msgpack")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://sandbox.rollfi.xyz/adminPortal#updateUser")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/x-msgpack")
.body("{\n \"method\": \"updateUser\",\n \"user\": {\n \"userId\": \"5F45CFBA-4AED-41AF-B334-E02D23BA17AE\",\n \"firstName\": \"Joe\",\n \"lastName\": \"Bloggs\",\n \"phoneNumber\": \"9889890989\",\n \"email\": \"joeBloggs@mailsac.com\",\n \"dateOfJoin\": \"2000-01-01\",\n \"workerType\": \"W2\",\n \"jobTitle\": \"Manager\",\n \"companyLocationCategory\": \"Office\",\n \"stateCode\": \"AL\",\n \"companyLocationId\": \"9721384B-0367-41DD-BD64-EF8047E8FD71\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.rollfi.xyz/adminPortal#updateUser")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/x-msgpack'
request.body = "{\n \"method\": \"updateUser\",\n \"user\": {\n \"userId\": \"5F45CFBA-4AED-41AF-B334-E02D23BA17AE\",\n \"firstName\": \"Joe\",\n \"lastName\": \"Bloggs\",\n \"phoneNumber\": \"9889890989\",\n \"email\": \"joeBloggs@mailsac.com\",\n \"dateOfJoin\": \"2000-01-01\",\n \"workerType\": \"W2\",\n \"jobTitle\": \"Manager\",\n \"companyLocationCategory\": \"Office\",\n \"stateCode\": \"AL\",\n \"companyLocationId\": \"9721384B-0367-41DD-BD64-EF8047E8FD71\"\n }\n}"
response = http.request(request)
puts response.read_body{
"user": {
"userId": "673F4A1C-ABD9-4E20-A235-66ED7CA71E8D",
"status": "Ready",
"message": "The User's data has been updated successfully."
}
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Response
Show child attributes
Show child attributes
