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
Hey there,
Everything looks correct from what I can see. Can you provide an example of your body's output when you log the request to the console?
Have a wonderful day!
Eric Nelson | Manager - Developer Advocacy