Update users organization through API

Beantwortet


Gepostet 17. Sept. 2021

I currently have my users connected through AD.  I work for a school district and the users organization is their school.  When my users change schools their organization doesn't update.  I am looking to update through the API and everything looks like it works with no error messages but nothing changes.  I even tried changing a users name and it looked like it worked but it didn't update.  Below is a snippet of my PowerShell code.

 

 

$url = 'https://{company}.zendesk.com/api/v2/users/'
$url = $url + {userID}
$url = $url + '.json'
$url

$zenname = {name}


$body = @{
user = @{
name = $zenname
organization_id = $orgid
}
}

$body = $body | ConvertTo-Json
$body

$headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$($Username):$($Token)"))}
#$headers = $headers | ConvertTo-Json
$contenttype = 'application/json'
$method = 'PUT'

 

Invoke-RestMethod -method $method -Uri $url -headers $headers -body $body -verbose


0

3

0 Kommentare

Anmelden, um einen Kommentar zu hinterlassen.

Sie finden nicht, wonach Sie suchen?

Neuer Post