Update User Role and associate Entitlement if provided and active
1 min
PUT
https://api.b.preview.loyaltyservices.io/api/v3/user-roles/{userRoleId}
Path Parameters
- userRoleIdinteger<int64>requiredDescriptionFormatint64
Body Parameters
- bodyUserRolerequired
- roleNamestringrequiredDescriptionMin Length1Max Length30
- roleDescriptionstringrequiredDescriptionMax Length200
- activebooleanDescription
- rankintegerrequiredDescriptionMinimum0Maximum9999
- channelCodestringExampleDescription
- entitlementsUserEntitlement[]Description
- namestringExampleDescription
- descriptionstringExampleDescription
Responses
200
- UserRole
- userRoleIdinteger<int64>DescriptionFormatint64
- roleNamestringrequiredDescriptionMin Length1Max Length30
- roleDescriptionstringrequiredDescriptionMax Length200
- activebooleanDescription
- rankintegerrequiredDescriptionMinimum0Maximum9999
- channelCodestringExampleDescription
- entitlementsUserEntitlement[]Description
- namestringExampleDescription
- descriptionstringExampleDescription
400
- ErrorResponse
- errorsValidationError[]Description
- codestringDescription
- fieldNamestringDescription
- messagestringDescription
- messageParametersobject[]Description
401
403
500
curl
curl --request PUT \
--url https://api.b.preview.loyaltyservices.io/api/v3/user-roles/{userRoleId} \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"roleName": "",
"roleDescription": "",
"rank": ""
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"roleName": "",
"roleDescription": "",
"rank": ""
});
var requestOptions = {
method: 'PUT',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.b.preview.loyaltyservices.io/api/v3/user-roles/{userRoleId}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.b.preview.loyaltyservices.io/api/v3/user-roles/{userRoleId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Put.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"roleName": "",
"roleDescription": "",
"rank": ""
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.b.preview.loyaltyservices.io/api/v3/user-roles/{userRoleId}"
payload = json.dumps({
"roleName": "",
"roleDescription": "",
"rank": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
200
// Success
{
"userRoleId": "",
"roleName": "",
"roleDescription": "",
"active": false,
"rank": 0,
"channelCode": "API",
"entitlements": [
{
"name": "twa:member:search",
"description": "Tally Call Center: Search Member"
}
]
}400
// Bad request
{
"errors": [
{
"code": "",
"fieldName": "",
"message": "",
"messageParameters": [
{}
]
}
]
}401
// Unauthorized
403
// Forbidden
500
// Internal error