We are using PHP to create and update Workplace accounts via the Workplace Account Management API.
Creating and updating accounts is working perfectly, but we have a new requirement where we'd like to automatically set users as invited via the API, mainly so we can get the claimLink from the API and send it in our own custom email to the user.
I am following the details here (see "update account from not invited to invited"): https://developers.facebook.com/docs/workplace/account-management/api
It seems the PUT request I am sending is successful (no errors), but it is not changing the invited flag from false to true as the documentation outlines.
Request Body:
... (Object) stdClass
schemas (Array, 3 elements)
0 (String, 25 characters ) urn:scim:schemas:core:1.0
1 (String, 41 characters ) urn:scim:schemas:extension:enterprise:1.0
2 (String, 60 characters ) urn:scim:schemas:extension:facebook:accountstat...
urn:scim:schemas:extension:facebook:accountstatusdetails:1.0
userName (String, 13 characters ) <my email address>
name (Array, 3 elements)
formatted (String, 7 characters ) AC Test
familyName (String, 4 characters ) Test
givenName (String, 2 characters ) AC
title (String, 5 characters ) Owner
active (Boolean) TRUE
emails (Array, 1 element)
0 (Array, 1 element)
value (String, 13 characters ) <my email address>
urn:scim:schemas:extension:enterprise:1.0 (Array, 2 elements)
department (String, 3 characters ) ,
manager (Object) stdClass
managerId (String, 15 characters ) <a workplace id>
addresses (Array, 1 element)
0 (Array, 8 elements)
type (String, 4 characters ) work
formatted (String, 4 characters ) TEST
streetAddress (String, 0 characters )
locality (String, 0 characters )
region (String, 0 characters )
postalCode (String, 0 characters )
country (String, 2 characters ) US
primary (Boolean) TRUE
urn:scim:schemas:extension:facebook:accountstatusdetails:1.0 (Array, 2 elements)
invited (Boolean) TRUE
inviteDate (Integer) 0
Response:
... (Object) stdClass
schemas (Array, 5 elements)
0 (String, 25 characters ) urn:scim:schemas:core:1.0
1 (String, 41 characters ) urn:scim:schemas:extension:enterprise:1.0
2 (String, 54 characters ) urn:scim:schemas:extension:facebook:starttermda...
urn:scim:schemas:extension:facebook:starttermdates:1.0
3 (String, 60 characters ) urn:scim:schemas:extension:facebook:accountstat...
urn:scim:schemas:extension:facebook:accountstatusdetails:1.0
4 (String, 51 characters ) urn:scim:schemas:extension:facebook:auth_method...
urn:scim:schemas:extension:facebook:auth_method:1.0
id (Float) <my workplace id>
userName (String, 13 characters ) <my email address>
name (Object) stdClass
formatted (String, 7 characters ) AC Test
familyName (String, 4 characters ) Test
givenName (String, 2 characters ) AC
title (String, 5 characters ) Owner
active (Boolean) TRUE
emails (Array, 1 element)
0 (Object) stdClass
primary (Boolean) FALSE
value (String, 13 characters ) <my email address>
addresses (Array, 1 element)
0 (Object) stdClass
type (String, 4 characters ) work
formatted (String, 4 characters ) TEST
country (String, 2 characters ) US
primary (Boolean) TRUE
urn:scim:schemas:extension:enterprise:1.0 (Object) stdClass
department (String, 3 characters ) ,
manager (Object) stdClass
managerId (Float) <workplace id>
urn:scim:schemas:extension:facebook:starttermdates:1.0 (Object) stdClass
startDate (Integer) 0
termDate (Integer) 0
urn:scim:schemas:extension:facebook:accountstatusdetails:1.0 (Object) stdClass
claimed (Boolean) FALSE
invited (Boolean) FALSE
inviteDate (Integer) 0
I'm not sure if there's something wrong with my request, or if perhaps there is Workplace Configuration that is interferring with the PUT API request?
Any help would be appreciated. Thanks in advance!
Although the documentation outlines a way to change the invited flag to true via a PUT request, we were able to confirm with Workplace developers that this is not the case.
To workaround this issue we changed Workplace configuration to auto-invite users, which in turn automatically generates a claim link, which can be retrieved via the API.