Introduction

This is an example for a REST call to insert/update an Alias on a user.


Example


file : json.txt

{

"email" : "admin",

"oa" : false,

"password" : "XXXXXX"

}

 

file : json2.txt

{

"email" : "user@mydomain.com",

"alias8" : "example8"

}

 

 

$response = Invoke-RestMethod 'https://mydomain.com:8443/api/auth/login' -Method Post  -ContentType 'application/json' -InFile .\json.txt 

$auth='Bearer ' + $response.token

Invoke-RestMethod 'https://mydomain.com:8443/api/users/1/personal' -Method Put -InFile .\json2.txt -ContentType 'application/json' -Headers @{'Authorization'=$auth}


We don’t use a token API. You need an admin with a long password.


The email is the user name that you login with


If instead using a password you want to authenticate using the Octopus --> change  "oa" : true
Footer - Secret Double Octopus