-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
100 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
Admin API Documentation | ||
======================= | ||
|
||
- `API Endpoint`_ | ||
- `Errors`_ | ||
- :doc:`User API <user>` | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:name: toc-loyalty-admin-documentation | ||
:hidden: | ||
|
||
user | ||
|
||
API Endpoint | ||
------------ | ||
|
||
The API is located at the following URL:: | ||
|
||
https://botisimo.com/api/v1/loyalty/admin | ||
|
||
Authenticating Requests | ||
----------------------- | ||
|
||
Authenticated requests should include a ``Client ID`` generated from your Botisimo account `profile <https://botisimo.com/account/profile>`_ as a header on the request ``client-id`` | ||
|
||
.. code-block:: js | ||
const response = await axios.post('https://botisimo.com/api/v1/loyalty/admin/user/1/points', { ... }, { | ||
headers: { | ||
'client-id': 'xxxxx-xxxxx-xxxxx-xxxxx', | ||
}, | ||
}); | ||
Errors | ||
------ | ||
|
||
Any errors will be returned with a non-2XX status code. | ||
|
||
Response | ||
|
||
=========== ======== ========================================== | ||
Field Type Description | ||
=========== ======== ========================================== | ||
message string The message describing the error | ||
=========== ======== ========================================== | ||
|
||
Example | ||
|
||
.. code-block:: js | ||
{ | ||
message: "An error has occurred" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
User API | ||
======== | ||
|
||
- `Add Points`_ | ||
|
||
Add Points | ||
---------- | ||
|
||
Add points to a user | ||
|
||
- **POST** /user/:id/points | ||
|
||
Request | ||
|
||
=========== ======== ============================================================================================================= | ||
Field Type Description | ||
=========== ======== ============================================================================================================= | ||
points number The amount of points to add to the user | ||
message string The message to log with the transaction | ||
key [string] If included, transactions will be limited to one key per user (this will prevent duplicate point assignments) | ||
=========== ======== ============================================================================================================= | ||
|
||
.. code-block:: js | ||
const response = await axios.post('https://botisimo.com/api/v1/loyalty/admin/user/1/points', { | ||
points: 100, | ||
message: 'Watched VOD content', | ||
key: '12345xyz', | ||
}, { | ||
headers: { | ||
'client-id': 'xxxxx-xxxxx-xxxxx-xxxxx', | ||
}, | ||
}); | ||
Response | ||
|
||
================================== ======== ================================================================================= | ||
Field Type Description | ||
================================== ======== ================================================================================= | ||
success boolean always true | ||
================================== ======== ================================================================================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ Loyalty | |
:maxdepth: 1 | ||
:name: toc-loyalty | ||
|
||
documentation/index | ||
user-documentation/index | ||
admin-documentation/index |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.