Additional Examples

On this page we'll add additional samples on how to use REST API.

Get all delegations created by a user

# Get delegator profile id using email
$profileId = ((Invoke-WebRequest -Uri "https://HostName:30000/StoreName/api/Profile?email=alice@example.com" -Headers @{"accept"="application/json";"Authorization"="Bearer YOURKEY"}).Content | ConvertFrom-Json).ProfileId
# Get delegations created by user
$wc = Invoke-WebRequest -Uri "https://HostName:30000/StoreName/api/api/Delegation?delegator=$($profileId)" -Headers @{"accept"="application/json";"Authorization"="Bearer YOURKEY"}
$wc.Content | ConvertFrom-Json

Get all delegations

$wc = Invoke-WebRequest -Uri "https://HostName:30000/StoreName/api/api/Delegation" -Headers @{"accept"="application/json";"Authorization"="Bearer YOURKEY"}
$wc.Content | ConvertFrom-Json

Get all active delegations

$wc = Invoke-WebRequest -Uri "https://HostName:30000/StoreName/api/api/Delegation" -Headers @{"accept"="application/json";"Authorization"="Bearer YOURKEY"}
($wc.Content | ConvertFrom-Json) | Where-Object { $_.Active -eq $true}

Get all delegations to a delegatee

$wc = Invoke-WebRequest -Uri "https://HostName:30000/StoreName/api/api/Delegation?delegatee=35059309-6738-4199-8142-f2f1d0c4efff" -Headers @{"accept"="application/json";"Authorization"="Bearer YOURKEY"}
$wc.Content | ConvertFrom-Json