Get all permissions for a user
1 min
GET
https://api.upstartcommerce.com/profile-permissions/users/{userId}/permissions
Path Parameters
- userIdstring<uuid>requiredDescriptionFormatuuid
Query Parameters
- prefixstringExampleDescription
Responses
200
- UserPermissionsResponseDescription
- userIdstring<uuid>requiredFormatuuid
- permissionsUserPermission[]requiredDescription
- namestringrequiredExampleDescription
- permissionDescriptionstringDescription
- sourcesstring[]requiredExample
[ "role:operator", "role:admin" ]
Description - grantedAtstring<date-time>requiredDescriptionFormatdate-time
401
- ErrorResponseDescription
- errorstring<bad_request | unauthorized | forbidden | not_found | conflict | internal_error>requiredExampleDescriptionAllowedbad_requestunauthorizedforbiddennot_foundconflictinternal_error
- messagestringrequiredExampleDescription
- detailsmap<string, string>Description
404
- ErrorResponseDescription
- errorstring<bad_request | unauthorized | forbidden | not_found | conflict | internal_error>requiredExampleDescriptionAllowedbad_requestunauthorizedforbiddennot_foundconflictinternal_error
- messagestringrequiredExampleDescription
- detailsmap<string, string>Description
500
- ErrorResponseDescription
- errorstring<bad_request | unauthorized | forbidden | not_found | conflict | internal_error>requiredExampleDescriptionAllowedbad_requestunauthorizedforbiddennot_foundconflictinternal_error
- messagestringrequiredExampleDescription
- detailsmap<string, string>Description
curl
curl --request GET \
--url https://api.upstartcommerce.com/profile-permissions/users/{userId}/permissions \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.upstartcommerce.com/profile-permissions/users/{userId}/permissions", 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.upstartcommerce.com/profile-permissions/users/{userId}/permissions")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.upstartcommerce.com/profile-permissions/users/{userId}/permissions"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// List of user permissions
{
"userId": "",
"permissions": [
{
"name": "order.read",
"permissionDescription": "",
"sources": [
""
],
"grantedAt": ""
}
]
}401
// Missing or invalid authentication token
{
"error": "not_found",
"message": "Role not found",
"details": ""
}404
// User not found
{
"error": "not_found",
"message": "Role not found",
"details": ""
}500
// Internal server error
{
"error": "not_found",
"message": "Role not found",
"details": ""
}