Skip to content

Commit

Permalink
add axios examples and response JSON examples
Browse files Browse the repository at this point in the history
  • Loading branch information
otothea committed Apr 8, 2022
1 parent bd29b5f commit c80d770
Show file tree
Hide file tree
Showing 9 changed files with 390 additions and 100 deletions.
18 changes: 9 additions & 9 deletions docs/loyalty/documentation/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ tier number Tier ID
.. code-block:: js
const response = await axios.post('https://botisimo.com/api/v1/loyalty/:team/login', {
email: 'xxxxx',
password: 'xxxxx',
interval: 'month',
dateOfBirth: '12/25/1990',
tier: 1,
tags: [1, 2, 3, 4],
email: 'xxxxx',
password: 'xxxxx',
interval: 'month',
dateOfBirth: '12/25/1990',
tier: 1,
tags: [1, 2, 3, 4],
});
Response
Expand Down Expand Up @@ -86,8 +86,8 @@ password string
.. code-block:: js
const response = await axios.post('https://botisimo.com/api/v1/loyalty/:team/login', {
email: 'xxxxx',
password: 'xxxxx',
email: 'xxxxx',
password: 'xxxxx',
});
Response
Expand Down Expand Up @@ -182,7 +182,7 @@ user.tags.name string The name of the tag

Example

.. code-block:: json
.. code-block:: js
{
"unread": 0,
Expand Down
44 changes: 44 additions & 0 deletions docs/loyalty/documentation/billing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ interval string The billing interval. Should be ``month`` or ``year``
tier number Tier ID
=========== ======== =====================================================

.. code-block:: js
const response = await axios.get('https://botisimo.com/api/v1/loyalty/:team/billing/upgrade', {
params: {
interval: 'month',
tier: 1
},
headers: {
'x-user-auth-token': 'xxxxxxx',
},
});
Response

=========== ======== =============================================================================================================================================================
Expand All @@ -32,6 +44,12 @@ amountDue [number] The amount due in cents to process the upgrade. If included
href [string] If included, you should immediately redirect to this href
=========== ======== =============================================================================================================================================================

.. code-block:: js
{
"amountDue": 4999
}
Confirm Upgrade Tier
--------------------

Expand All @@ -48,6 +66,18 @@ interval string The billing interval. Should be ``month`` or ``year``
tier number Tier ID
=========== ======== =====================================================

.. code-block:: js
const response = await axios.get('https://botisimo.com/api/v1/loyalty/:team/billing/confirm', {
params: {
interval: 'month',
tier: 1
},
headers: {
'x-user-auth-token': 'xxxxxxx',
},
});
Manage Billing
--------------

Expand All @@ -63,10 +93,24 @@ Field Type Description
\- \- \-
=========== ======== ==========================================

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

=========== ======== ==========================================
Field Type Description
=========== ======== ==========================================
href string The href to the billing management session
=========== ======== ==========================================

.. code-block:: js
{
"href": "https://xxxxx"
}
122 changes: 122 additions & 0 deletions docs/loyalty/documentation/creators.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
Creators API
============

- `List Creators`_

List Creators
-------------

List creators

- **GET** /creator/list

Request

=========== ======== ==========================================
Field Type Description
=========== ======== ==========================================
\- \- \-
=========== ======== ==========================================

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

================================================ ======== =======================================
Field Type Description
================================================ ======== =======================================
creators object[]
creators.id string The ID of the creator
creators.hasTwitch boolean
creators.twitchConnections object[]
creators.twitchConnections.twitchId string
creators.twitchConnections.twitchLogo string
creators.twitchConnections.twitchDisplayName string
creators.twitchConnections.enabled boolean
creators.twitchConnections.online boolean
creators.twitchConnections.currentViewers number
creators.hasYoutube boolean
creators.youtubeConnections object[]
creators.youtubeConnections.youtubeId string
creators.youtubeConnections.youtubeLogo string
creators.youtubeConnections.youtubeDisplayName string
creators.youtubeConnections.enabled boolean
creators.youtubeConnections.online boolean
creators.youtubeConnections.currentViewers number
creators.hasFacebook boolean
creators.facebookConnections object[]
creators.facebookConnections.facebookId string
creators.facebookConnections.facebookLogo string
creators.facebookConnections.facebookDisplayName string
creators.facebookConnections.enabled boolean
creators.facebookConnections.online boolean
creators.facebookConnections.currentViewers number
creators.hasTwitter boolean
creators.twitterConnections object[]
creators.twitterConnections.twitterId string
creators.twitterConnections.twitterLogo string
creators.twitterConnections.twitterDisplayName string
creators.twitterConnections.enabled boolean
creators.twitterConnections.online boolean
creators.twitterConnections.currentViewers number
creators.live boolean
creators.logo string
================================================ ======== =======================================

Example

.. code-block:: js
{
creators: [
{
"id": 137459,
"hasTwitch": true,
"twitchConnections": [
{
"twitchId": 10488316,
"twitchLogo": "https://static-cdn.jtvnw.net/jtv_user_pictures/57856422-762e-4373-b22a-a58735d974c0-profile_image-300x300.png",
"twitchDisplayName": "TeamEnvy",
"enabled": false,
"online": false,
"currentViewers": 0
}
],
"hasYoutube": true,
"youtubeConnections": [
{
"youtubeId": "UCZyoek-4iDviS-yIuJKUh2Q",
"youtubeLogo": "https://yt3.ggpht.com/ytc/AAUvwngFUYMT3mmFtOJzEf7WrZLO3cQcZkSKSnjJIGprtA=s88-c-k-c0x00ffffff-no-rj",
"youtubeDisplayName": "Envy",
"youtubeBroadcastId": "",
"enabled": false,
"online": false,
"currentViewers": 0
}
...
],
"hasFacebook": false,
"facebookConnections": [],
"hasTwitter": true,
"twitterConnections": [
{
"twitterId": "115038550",
"twitterName": "Envy",
"twitterDisplayName": "Envy",
"twitterLogo": "https://pbs.twimg.com/profile_images/1375486379531104259/bBrCuYV3_normal.png",
"online": false,
"currentViewers": 0
}
...
],
"live": false,
"logo": "https://static-cdn.jtvnw.net/jtv_user_pictures/57856422-762e-4373-b22a-a58735d974c0-profile_image-300x300.png",
}
]
}
38 changes: 38 additions & 0 deletions docs/loyalty/documentation/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ Field Type Description
\- \- \-
=========== ======== ==========================================

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

=================== ======== =======================================
Expand Down Expand Up @@ -54,6 +62,14 @@ Field Type Description
\- \- \-
=========== ======== ==========================================

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

================== ======== ==================================================
Expand All @@ -73,3 +89,25 @@ event.tags object[] List of tags
event.tags.id number The ID of the tag
event.tags.name string The name of the tag
================== ======== ==================================================

Example

.. code-block:: js
{
"event": {
"status": "completed",
"id": 6,
"name": "OpTic Major 1 Tournament",
"description": "Tickets Are Now Available for the OpTic Major I",
"callToAction": "GET TICKETS",
"url": "https://www.tixr.com/groups/optictexas/events/optic-texas-major-i-35567",
"location": "Esports Stadium Arlington",
"start": 1649008800,
"end": 1649296800,
"resourceId": 6681,
"createdAt": "2022-03-16T03:15:21.000Z",
"updatedAt": "2022-03-16T03:17:56.000Z",
"tags": []
}
}
6 changes: 4 additions & 2 deletions docs/loyalty/documentation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ API Documentation
- :doc:`Authentication API <authentication>`
- :doc:`Billing API <billing>`
- :doc:`Tiers API <tiers>`
- :doc:`Creators API <creators>`
- :doc:`Missions API <missions>`
- :doc:`Shop Items API <shopItems>`
- :doc:`Events API <events>`
Expand All @@ -20,8 +21,9 @@ API Documentation
authentication
billing
tiers
shopItems
creators
missions
shopItems
events

API Endpoint
Expand Down Expand Up @@ -66,7 +68,7 @@ message string The message describing the error

Example

.. code-block:: json
.. code-block:: js
{
message: "An error has occurred"
Expand Down
24 changes: 24 additions & 0 deletions docs/loyalty/documentation/missions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ Field Type Description
\- \- \-
=========== ======== ==========================================

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

==================== ======== =======================================
Expand Down Expand Up @@ -51,6 +59,14 @@ Field Type Description
\- \- \-
=========== ======== ==========================================

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

=================== ======== =======================================
Expand Down Expand Up @@ -82,6 +98,14 @@ Field Type Description
\- \- \-
=========== ======== ==========================================

.. code-block:: js
const response = await axios.put('https://botisimo.com/api/v1/loyalty/:team/mission/1/redeem', {}, {
headers: {
'x-user-auth-token': 'xxxxxxx',
},
});
Response

=================== ======== =======================================
Expand Down

0 comments on commit c80d770

Please sign in to comment.