Skip to content

Commit

Permalink
add loyalty admin api
Browse files Browse the repository at this point in the history
  • Loading branch information
otothea committed Sep 23, 2022
1 parent 5d4525e commit e623811
Show file tree
Hide file tree
Showing 16 changed files with 100 additions and 4 deletions.
54 changes: 54 additions & 0 deletions docs/loyalty/admin-documentation/index.rst
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"
}
41 changes: 41 additions & 0 deletions docs/loyalty/admin-documentation/user.rst
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
================================== ======== =================================================================================
3 changes: 2 additions & 1 deletion docs/loyalty/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
API Documentation
=================
User API Documentation
======================

- `API Endpoint`_
- `Errors`_
Expand All @@ -18,7 +18,7 @@ API Documentation

.. toctree::
:maxdepth: 1
:name: toc-loyalty-documentation
:name: toc-loyalty-user-documentation
:hidden:

team
Expand Down
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.

0 comments on commit e623811

Please sign in to comment.