Skip to content

Commit

Permalink
add json examples
Browse files Browse the repository at this point in the history
  • Loading branch information
otothea committed Apr 8, 2022
1 parent 6194427 commit 940b73e
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/commands/custom/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ You can create custom commands by visiting the `commands page <https://botisimo.
Related Videos
^^^^^^^^^^^^^^

.. youtube:: 5j-QSMc23nk
.. youtube:: PlwT6U3_Sf0
9 changes: 9 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,12 @@ Extras
:name: sec-extras

extras/index

Loyalty (Enterprise)
^^^^^^^^^^^^^^^^^^^^

.. toctree::
:maxdepth: 1
:name: sec-loyalty

loyalty/index
32 changes: 30 additions & 2 deletions docs/loyalty/documentation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,29 @@ API Documentation
API Endpoint
------------

The API is located at the following URL. You should replace ``:team`` with your team's name in your Botisimo account
The API is located at the following URL. You should replace ``:team`` with your team's name in your Botisimo account::

``https://botisimo.com/api/v1/loyalty/:team``
https://botisimo.com/api/v1/loyalty/:team

Authenticating Requests
-----------------------

Authenticated requests should include the ``token`` received from :doc:`Authentication API <authentication>` as a header on the request ``x-user-auth-token``

.. code-block:: js
const response = await axios.get('https://botisimo.com/api/v1/loyalty/:team/mission/list', {
headers: {
'x-user-auth-token': 'xxxxxxx',
},
});
Fetching Media Resources
------------------------

Some objects have a ``resourceId`` that correlates to a media file in S3. You can fetch any resource by using the ``resourceId``::

https://s3.amazonaws.com/prod.botisimo.com/resource/:resourceId

Errors
------
Expand All @@ -43,3 +63,11 @@ Field Type Description
=========== ======== ==========================================
message string The message describing the error
=========== ======== ==========================================

Example

.. code-block:: json
{
message: "An error has occurred"
}
56 changes: 56 additions & 0 deletions docs/loyalty/documentation/team.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,59 @@ team.tags object[] List of tags
team.tags.id number The ID of the tag
team.tags.name string The name of the tag
============================ ======== =======================================

Example

.. code-block:: json
{
"team": {
"name": "OpTic Gaming",
"currencyName": "Points",
"loyaltyTiers": [
{
"id": 4,
"enabled": true,
"order": 0,
"name": "Silver",
"description": "Stay connected with your favorite teams, players, and creators at OpTic!",
"priceMonth": 0,
"priceYear": 0,
"gold": 0,
"goldMultiplier": 1,
"stripeProductId": "prod_xxxxx",
"stripeMonthlyPlanId": "plan_xxxxx
"stripeYearlyPlanId": "plan_xxxxx",
"stripePointsPlanId": "price_xxxxx",
"resourceId": 6812,
"badgeResourceId": null,
"createdAt": "2022-03-07T22:58:17.000Z",
"updatedAt": "2022-03-19T15:25:25.000Z"
},
...
],
"tags": [
{
"id": 3,
"name": "OpTic Texas",
"createdAt": "2022-03-07T23:15:50.000Z"
},
{
"id": 4,
"name": "OpTic Gaming",
"createdAt": "2022-03-07T23:16:12.000Z"
},
{
"id": 5,
"name": "H3CZ",
"createdAt": "2022-03-07T23:16:28.000Z"
},
{
"id": 6,
"name": "Hitch",
"createdAt": "2022-03-08T21:37:51.000Z"
},
...
],
}
}

0 comments on commit 940b73e

Please sign in to comment.