but i must make some script in php to populate our workplace from our database on a test workplace (so i have only 28day).
i have search for exemple to use the api cim from workplace. I search the web than 2 days but i don't find anything.
To test i just want to have the list of claimed user to understand how it goes with php.
I have try this :
<?php
$url = 'https://www.workplace.com/scim/v1/Users';
$json = '{"urn:scim:schemas:extension:facebook:accountstatusdetails:1.0" :{ "claimed": true}}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Content-Type: application/json',
'Content-Length: ' . strlen($json),
'Authorization: Bearer mytoken'
)
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
$result=curl_exec ($ch);
echo $result;
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo "status :".$status_code."<br>"; //get status code
curl_close ($ch);
?>
the result give me "1" and the status give me 302.
can someone explain what is false, or where ican find a simple tutorial to start ?
Thank you
Thierry
Sorry for this question, after search and mixt answer i have found:
The simpla code with wordplace scim api to get all user ofthe company is :
The user agent is important. it work in commendline. so in cronjob to. Know i have my basis to create member, and to update member when emails are changing.
Thank's
Thierry