Difference between revisions of "Simple Groups API/set http callback"
From SmartBots Developers Docs
(Created page with "{{DISPLAYTITLE: set_http_callback}} <onlyinclude>Set HTTP callback to be called on group events.</onlyinclude> {{API Variables Table}} {{API HTTP Group Required Vars|invite}...") |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
{{API Variables Table}} | {{API Variables Table}} | ||
− | {{API HTTP Group Required Vars| | + | {{API HTTP Group Required Vars|set_http_callback}} |
{{API Variable Group|Input}} | {{API Variable Group|Input}} | ||
− | |||
− | |||
{{API Variable|group|yes}} the group '''name''' (must be listed with SmartBots!) | {{API Variable|group|yes}} the group '''name''' (must be listed with SmartBots!) | ||
− | |||
{{API Variable|app_name|yes}} The application name (provided by developer, visible to the user) | {{API Variable|app_name|yes}} The application name (provided by developer, visible to the user) | ||
{{API Variable|app_uuid|yes}} The application UUID (provided by developer, not visible) | {{API Variable|app_uuid|yes}} The application UUID (provided by developer, not visible) | ||
Line 16: | Line 13: | ||
{{API Variable Group|Output (JSON formatted)}} | {{API Variable Group|Output (JSON formatted)}} | ||
− | {{API | + | {{API Variable|result|yes}} OK in case of success, FAIL on error |
+ | {{API Variable|resulttext|on failure}} Error explanation (if applicable) | ||
+ | {{API Variable|group_uuid|on success}} Group UUID | ||
+ | {{API Variable|group_id|on success}} "Group ID" - the persistent string ID which identifies the group | ||
{{API Variables Table End}} | {{API Variables Table End}} | ||
Line 27: | Line 27: | ||
* apikey - see [https://www.mysmartbots.com/dev/docs/HTTP_API/Developer%27s_API_key SmartBots docs] | * apikey - see [https://www.mysmartbots.com/dev/docs/HTTP_API/Developer%27s_API_key SmartBots docs] | ||
+ | * app_name - developer gives a readable name for his app. User can see the list of connected apps while checking his group security settings | ||
+ | * app_uuid - the UUID of the app. Developer generates this UUID on its own | ||
+ | * url - the URL to deliver callbacks to | ||
+ | The user should provide by developer's request: | ||
+ | |||
+ | * group - the group name | ||
+ | * secret - the Group Security Code | ||
+ | |||
+ | == Callback persistence == | ||
+ | |||
+ | All callbacks are being REMOVED when user changes the Group Security Code. Once removed, you should ask customer to re-add callback by providing a new Security Code. | ||
+ | |||
+ | == Callbacks == | ||
+ | |||
+ | Your URL gets POST request when following events occur: | ||
+ | |||
+ | * callback_set - when callback has been set up | ||
+ | * callback_removed - when callback is removed by user's request | ||
+ | * group_chat - when group chat message is received | ||
Latest revision as of 14:12, 22 February 2022
Set HTTP callback to be called on group events.
Variables
The following table shows input values (you send them with the API call) and returned output values.
Variable | Required | Description | |
---|---|---|---|
Input base: | |||
action | yes | = set_http_callback | |
apikey | yes | Your personal developer's API key. | |
secret | yes | Security code of the group you are using. | |
secret_sha1 | optional | The same as "secret" but hashed using SHA1 (useful if you don't want to keep plain customer's passwords) | |
Input: | |||
group | yes | the group name (must be listed with SmartBots!) | |
app_name | yes | The application name (provided by developer, visible to the user) | |
app_uuid | yes | The application UUID (provided by developer, not visible) | |
url | yes | The URL to be called on group events | |
Output (JSON formatted): | |||
result | yes | OK in case of success, FAIL on error | |
resulttext | on failure | Error explanation (if applicable) | |
group_uuid | on success | Group UUID | |
group_id | on success | "Group ID" - the persistent string ID which identifies the group |
Comments
This API call required information both from developer of an application (which received the callback) and from a customer.
The developer should provide the following data:
- apikey - see SmartBots docs
- app_name - developer gives a readable name for his app. User can see the list of connected apps while checking his group security settings
- app_uuid - the UUID of the app. Developer generates this UUID on its own
- url - the URL to deliver callbacks to
The user should provide by developer's request:
- group - the group name
- secret - the Group Security Code
Callback persistence
All callbacks are being REMOVED when user changes the Group Security Code. Once removed, you should ask customer to re-add callback by providing a new Security Code.
Callbacks
Your URL gets POST request when following events occur:
- callback_set - when callback has been set up
- callback_removed - when callback is removed by user's request
- group_chat - when group chat message is received
<< return back to group commands