All information that comes to Promptchat from an external site is obtained from "Auth user URL"
On the demo site that we use for external authorization, it looks as follows:
See this on https://exauth.promptchat.com
In this case, the User will be logged in with the dynamic role "tester" and with access rights indicated on the screenshot.
Also, I will separately write down all the abilities that can be assigned in a dynamic role:
- "manageStatistic",
- "manageGoogleAccount",
- "manageClient",
- "manageChatBoard",
- "manageTag",
- "manageCampaign",
- "manageCalendar",
- "manageInstantMessage",
- "manageChatbot",
- "manageIntegration",
- "manageWebChatbotLayout",
- "manageShop",
- "manageQuickReply",
If the user has a role ID 1 or 2 or 3 then the "abilities" do not need to be specified, because this role is static. For example:
All that is required to connect an external site to Promptchat is setting the site configuration.
The two sites must have the same domain name.
“Auth user URL” - this is a link to a page that provides user data in json format.
“API token for patches” - this is a token used to transfer data in a packet.
Here is an example of a request that you can pass to the promptchat site to populate the data:
curl --location 'https://alpha.exauth.promptchat.com/api/system/batches' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 9krlzg5d7k00000000000000000000000000' \
--data-raw '{
"patches": [
{
"entity": "company",
"entity_identifier": 9999,
"action": "create",
"data": {
"name": "123123 ooo"
}
},
{
"entity": "department",
"entity_identifier": 5555,
"action": "create",
"data": {
"name": "123123 ooo",
"company_id": 9999
}
},
{
"entity": "department",
"entity_identifier": 5556,
"action": "create",
"data": {
"name": "123123 aaa",
"company_id": 9999
}
},
{
"entity": "user",
"entity_identifier": "312",
"action": "update",
"data": {
"company_id": 9999,
"name": "vasia",
"timezone": "Europe/Kiev",
"role_id": 2,
"email": "myemail+211@gmail.com"
}
}
]
}'
Example of our test site https://exauth.promptchat.com/