When a match is found when registering a user via the api/webUsers API endpoint it would be really helpful if this could then return the following object as the response:
{
ok : true, // Server response 200
webUserExists : true, // Does the webUser exist in Administrate? If so return the following companies array
companies : [
{
id : 413, // Administrate Company Id
canBook : true, // This webUser can book a course as an employee of the company
isHr : true // This webUser can book a course on behalf of other company employees
},
{
id : 25, // Administrate Company Id
canBook : true, // This webUser can book a course as an employee of the company
isHr : false // This webUser can't book a course on behalf of other company employees
},
{
id : 111, // Administrate Company Id
canBook : false, // This webUser can't book a course as an employee of the company
isHr : false // This webUser can't book a course on behalf of other company employees
}
]
}
...if there is an error then return:
{
ok : false, // Server response 500, or data validation error
errorMessage : 'Lorem ipsum lorem ipsum' // Error message
}
If the above response can't be provided in realtime ( ie: there is step of validation required in Administrate which then needs to be feed back to the Integration Tier ), then I could provide an API endpoint on the website which would allow this information to be passed to the site using a similar method, eg:
Maybe the above call could be performed when inflating the relevant part of the Integration Tier? This would be helpful as I would be able to trigger it myself.
In the above case the webUser would only be able to book Courses as a Private user until such cases as the validation is complete.
@PeteHaK @joshgosselin
When a match is found when registering a user via the
api/webUsers
API endpoint it would be really helpful if this could then return the following object as the response:...if there is an error then return:
If the above response can't be provided in realtime ( ie: there is step of validation required in Administrate which then needs to be feed back to the Integration Tier ), then I could provide an API endpoint on the website which would allow this information to be passed to the site using a similar method, eg:
Maybe the above call could be performed when inflating the relevant part of the Integration Tier? This would be helpful as I would be able to trigger it myself.
In the above case the
webUser
would only be able to book Courses as a Private user until such cases as the validation is complete.