NAV
shell Javascript Java Objective-C

Basics

API

The API is located at https://peakapi.whitespell.com

Data Format Info
Payload JSON only This is to make it a lot easier to parse and post
Requests Query String Parameters Make sure to also use SSL
Encryption 256-bit SSL Make sure to also use SSL in your requests for the sake of our users
Max string length 255 Don’t post strings longer than 255 characters :-)

Design Schema

In order to better understand the API, here you can find a design schema of the endpoints. Please email pim@whitespell.com to request access.

Method Schema URL Info
Post data POST Used to add or update data
Request data GET Used to add or update data

Headers

Key Value Info
X-Authentication <userId>,<key> User authentication header
Authorization <api_key> Your developer key

Variables

You can send data to the API in 3 different ways. Each method has a different meaning.

Key Example Info
URL Variables GET https://peakapi.whitespell.com/users/<userId> This is used when the value is guaranteed to be unique and you are directly accessing an object
Query String Variables GET https://peakapi.whitespell.com/users/categories/?categories=1,2,3&limit=10 This is mainly used to specify/narrow a result set or search for certain values.
Request Body (Payload) POST https://peakapi.whitespell.com/categories -> {"categoryName" : "new_category"} This is used in the body of the request, also known as the payload. We only accept JSON payloads.

Errors

curl "http://peakapi.whitespell.com/users/categories?" \
  -H "Authorization: YOUR_API_KEY" \
  -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY"

Because the ‘categories’ parameter is missing in the query string, and it is a required parameter, the following JSON error will be thrown

{
    "className" :   "GetUsersByCategory",
    "httpStatusCode"    :   400,
    "errorId"   :   113,
    "errorMessage"  :   "Required key 'categories' was not found in the query string. See the documentation for all the requirements."
}

The API has a really good error informative reporting system, making it super simple for developers to use the API and learn from there errors.

Parameter Meaning
className The class the error was thrown in
httpStatusCode The status code that was returned by the API
errorId The error ID that was reported. Developers can use this to look up your error.
errorMessage More information about the error
Error Code Meaning
400 Bad Request – Your request contains information that is not acceptable, for example your JSON is not actually JSON
401 Unauthorized – Your API key is wrong or your X-Authentication is wrong.
403 Forbidden – You are not permitted to do this action
404 Not Found – The specified kitten could not be found
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temp. offline for maintanance. Please try again later.

Endpoints

Newsfeed

Get Newsfeed

    curl "https://peakapi.whitespell.com/newsfeed/USER_ID" \
    -H "Authorization: YOUR_API_KEY" \
    -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \

The above command returns JSON structured like this:

[
    {
        "newsfeedId":14122,
        {  
            "userId":134,
            "contentId":14131,
            "contentType":5,
            "categoryId":2,
            "contentTitle":"Introduction to Peak",
            "contentUrl":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl1080p":"https://s3.amazonaws.com/peak-users/vid/1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl720p":"https://s3.amazonaws.com/peak-users/vid/720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl480p":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl360p":"https://s3.amazonaws.com/peak-users/vid/360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl240p":"https://s3.amazonaws.com/peak-users/vid/240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl144p":"https://s3.amazonaws.com/peak-users/vid/144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview1080p":"https://s3.amazonaws.com/peak-users/vid/preview-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview720p":"https://s3.amazonaws.com/peak-users/vid/preview-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview480p":"https://s3.amazonaws.com/peak-users/vid/preview-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview360p":"https://s3.amazonaws.com/peak-users/vid/preview-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview240p":"https://s3.amazonaws.com/peak-users/vid/preview-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview144p":"https://s3.amazonaws.com/peak-users/vid/preview-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "thumbnail1080p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail720p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail480p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail360p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail240p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail144p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "socialMediaVideo":"https://s3.amazonaws.com/peak-users/vid/sm-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "videoLengthSeconds":98,
            "contentDescription":"This is a simple intro to peak",
            "likes":5,
            "views":0,
            "thumbnailUrl":"http://res.cloudinary.com/whitespell-inc/image/upload/v1444240687/dzkpmk9k6jkxpfabprop.png",
            "userLiked":0,
            "userSaved":0,
            "userViewed":0,
            "contentPrice":0.0,
            "hasAccess":1,
            "recommended":0,
            "poster":{  
                "userId":134,
                "publisher":1,
                "emailVerified":0,
                "emailNotifications":0,
                "userName":"pimdewitte",
                "displayName":"pim de witte",
                "email":"pim@whitespell.com",
                "thumbnail":"http://peakapp.me/img/app_assets/avatar.png",
                "coverPhoto":"http://peakapp.me/img/app_assets/cover.png",
                "slogan":"peek-a-boo"
            },
            "children":[  ],
            "processed":1,
            "parent":0
        }
    },
    {
        "newsfeedId":14121,
        {  
            "userId":134,
            "contentId":14131,
            "contentType":5,
            "categoryId":2,
            "contentTitle":"Introduction to Peak",
            "contentUrl":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl1080p":"https://s3.amazonaws.com/peak-users/vid/1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl720p":"https://s3.amazonaws.com/peak-users/vid/720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl480p":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl360p":"https://s3.amazonaws.com/peak-users/vid/360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl240p":"https://s3.amazonaws.com/peak-users/vid/240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl144p":"https://s3.amazonaws.com/peak-users/vid/144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview1080p":"https://s3.amazonaws.com/peak-users/vid/preview-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview720p":"https://s3.amazonaws.com/peak-users/vid/preview-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview480p":"https://s3.amazonaws.com/peak-users/vid/preview-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview360p":"https://s3.amazonaws.com/peak-users/vid/preview-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview240p":"https://s3.amazonaws.com/peak-users/vid/preview-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview144p":"https://s3.amazonaws.com/peak-users/vid/preview-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "thumbnail1080p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail720p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail480p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail360p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail240p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail144p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "socialMediaVideo":"https://s3.amazonaws.com/peak-users/vid/sm-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "videoLengthSeconds":98,
            "contentDescription":"This is a simple intro to peak",
            "likes":5,
            "views":0,
            "thumbnailUrl":"http://res.cloudinary.com/whitespell-inc/image/upload/v1444240687/dzkpmk9k6jkxpfabprop.png",
            "userLiked":0,
            "userSaved":0,
            "userViewed":0,
            "contentPrice":0.0,
            "hasAccess":1,
            "recommended":0,
            "poster":{  
                "userId":134,
                "publisher":1,
                "emailVerified":0,
                "emailNotifications":0,
                "userName":"pimdewitte",
                "displayName":"pim de witte",
                "email":"pim@whitespell.com",
                "thumbnail":"http://peakapp.me/img/app_assets/avatar.png",
                "coverPhoto":"http://peakapp.me/img/app_assets/cover.png",
                "slogan":"peek-a-boo"
            },
            "children":[  ],
            "processed":1,
            "parent":0
        }
    }
]

Authentication as the user is required

This endpoint returns the newsfeed for a given userId.

HTTP Request

GET https://peakapi.whitespell.com/newsfeed/USER_ID

QUERY Parameters

Parameter Default Description Status
offset 0 int(11) The contentId offset, newsfeed is sorted in descending order, so offset=11499 will show contentIds < 11499. Tested
limit 50 int(11) of the size of the newsfeed you’d like to see. E.g. 25 for 25 videos. Tested
categoryId 50 int(1) The category id of the newsfeed content, used for showing only content from the given category. Tested

Search

    curl "https://peakapi.whitespell.com/search?q=SEARCH_STRING" \
    -H "Authorization: YOUR_API_KEY" \
    -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \

The above command returns JSON structured like this:

{
    "users":[
        {
            "userId":11832,
            "publisher":-1,
            "emailVerified":0,
            "emailNotifications":0,
            "userName":"PeakFitness",
            "displayName":" peakfitness",
            "thumbnail":"http://peakapp.me/img/app_assets/avatar.png"
        }
    ],
    "categories":[
        2
    ],
    "content":[
        {
            "userId":134,
            "contentId":14131,
            "contentType":5,
            "categoryId":2,
            "contentTitle":"Introduction to Peak",
            "contentUrl":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl1080p":"https://s3.amazonaws.com/peak-users/vid/1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl720p":"https://s3.amazonaws.com/peak-users/vid/720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl480p":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl360p":"https://s3.amazonaws.com/peak-users/vid/360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl240p":"https://s3.amazonaws.com/peak-users/vid/240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl144p":"https://s3.amazonaws.com/peak-users/vid/144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview1080p":"https://s3.amazonaws.com/peak-users/vid/preview-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview720p":"https://s3.amazonaws.com/peak-users/vid/preview-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview480p":"https://s3.amazonaws.com/peak-users/vid/preview-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview360p":"https://s3.amazonaws.com/peak-users/vid/preview-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview240p":"https://s3.amazonaws.com/peak-users/vid/preview-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview144p":"https://s3.amazonaws.com/peak-users/vid/preview-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "thumbnail1080p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail720p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail480p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail360p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail240p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail144p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "socialMediaVideo":"https://s3.amazonaws.com/peak-users/vid/sm-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "videoLengthSeconds":98,
            "contentDescription":"This is a simple intro to peak",
            "likes":5,
            "views":0,
            "thumbnailUrl":"http://res.cloudinary.com/whitespell-inc/image/upload/v1444240687/dzkpmk9k6jkxpfabprop.png",
            "userLiked":0,
            "userSaved":0,
            "userViewed":0,
            "contentPrice":0.0,
            "hasAccess":1,
            "recommended":0,
            "poster":{  
                "userId":134,
                "publisher":1,
                "emailVerified":0,
                "emailNotifications":0,
                "userName":"pimdewitte",
                "displayName":"pim de witte",
                "email":"pim@whitespell.com",
                "thumbnail":"http://peakapp.me/img/app_assets/avatar.png",
                "coverPhoto":"http://peakapp.me/img/app_assets/cover.png",
                "slogan":"peek-a-boo"
            },
            "children":[  ],
            "processed":1,
            "parent":0
        }
    ]
}

Authentication as the user is required

This endpoint returns a JSON Object with a profiles array, a categories array (this returns the numbers of the searched categories, e.g. 1=football,2=skydiving,etc) and also a list of content. The categories object contains the categoryIds that match the search query. You can find the available categoryIds using the Request Categories endpoint.

HTTP Request

GET https://peakapi.whitespell.com/search/

QUERY Parameters

Parameter Default Description Status
q None REQUIRED String value of search query (e.g. chri) Tested
limit 50 If set, limit the amount of user objects you will get back by this amount. Tested
offset None If set, start loading from user ids only larger than the offset number (e.g. for infinite scrolling) Tested

Trending

    curl "https://peakapi.whitespell.com/trending"     

The above command returns JSON structured like this:

{
    "users":[
        {
            "userId":1337,
            "userName":"USER_NAME",
            "displayName":""
        }
    ],
    "categories":[
        4,
        3,
        2,
        1
    ],
    "content":[
        {
            "userId":134,
            "contentId":14131,
            "contentType":5,
            "categoryId":2,
            "contentTitle":"Introduction to Peak",
            "contentUrl":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl1080p":"https://s3.amazonaws.com/peak-users/vid/1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl720p":"https://s3.amazonaws.com/peak-users/vid/720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl480p":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl360p":"https://s3.amazonaws.com/peak-users/vid/360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl240p":"https://s3.amazonaws.com/peak-users/vid/240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl144p":"https://s3.amazonaws.com/peak-users/vid/144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview1080p":"https://s3.amazonaws.com/peak-users/vid/preview-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview720p":"https://s3.amazonaws.com/peak-users/vid/preview-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview480p":"https://s3.amazonaws.com/peak-users/vid/preview-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview360p":"https://s3.amazonaws.com/peak-users/vid/preview-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview240p":"https://s3.amazonaws.com/peak-users/vid/preview-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview144p":"https://s3.amazonaws.com/peak-users/vid/preview-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "thumbnail1080p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail720p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail480p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail360p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail240p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail144p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "socialMediaVideo":"https://s3.amazonaws.com/peak-users/vid/sm-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "videoLengthSeconds":98,
            "contentDescription":"This is a simple intro to peak",
            "likes":5,
            "views":0,
            "thumbnailUrl":"http://res.cloudinary.com/whitespell-inc/image/upload/v1444240687/dzkpmk9k6jkxpfabprop.png",
            "userLiked":0,
            "userSaved":0,
            "userViewed":0,
            "contentPrice":0.0,
            "hasAccess":1,
            "recommended":0,
            "poster":{  
                "userId":134,
                "publisher":1,
                "emailVerified":0,
                "emailNotifications":0,
                "userName":"pimdewitte",
                "displayName":"pim de witte",
                "email":"pim@whitespell.com",
                "thumbnail":"http://peakapp.me/img/app_assets/avatar.png",
                "coverPhoto":"http://peakapp.me/img/app_assets/cover.png",
                "slogan":"peek-a-boo"
            },
            "children":[  ],
            "processed":1,
            "parent":0
        }
    ]
}

This endpoint returns a JSON Object with a user object array, a categoryId array and also a content array of the trending content. Now trending users are sorted by amount of published content.

HTTP Request

GET https://peakapi.whitespell.com/trending/

Query Parameters

Parameter Default Description Status
limit 50 If set, limit or increase the amount of each object type (user, category, content) you will get back. Tested

Authentication

Authentication Request

curl -d \ '{"userName":"YOUR_USERNAME","password":"YOUR_PASSWORD","deviceName":"DEVICE_NAME","deviceType":1,"deviceUUID":"DEVICE_TOKEN","mac_address":"MAC_ADDRESS","geolocation":"LOCATION_INFO"}' \
-H "Content-Type: application/json" \
-X POST "https://peakapi.whitespell.com/authentication" 

The above command returns JSON structured like this:

[
    {
        "status"    :    "ok",
        "key"    :    "32bitstring",
        "expires"    :   137183918301
    }
]

This endpoint allows testing of authentication requests. If on a mobile client please include deviceName, deviceType and deviceUUID.

HTTP Request

POST https://peakapi.whitespell.com/authentication/

POST Parameters

Parameter Required Description Status
userName Yes String(30) Tested
password Yes String(inf) Tested
deviceName No String(255), Name of device in settings, e.g. “Users Phone” Tested
deviceType No BOOL, 0 or 1, 0 for iOS devices, 1 for Android Tested
deviceUUID No String(255), the identifying device token for the device Tested
mac_address No String(45) In Progress
geolocation No String(Lat, Lon, 45) In Progress

Users

Get All Users

curl "https://peakapi.whitespell.com/users/" \ 
  -H "Authorization: YOUR_API_KEY" \
  -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY"

The above command returns JSON structured like this:

[
    {
        "userFollowing": [],
        "categoryFollowing": [],
        "categoryPublishing": [],
        "userId": 0,
        "publisher" : 1,
        "userName": "example_name",
        "email": "hidden",
        "thumbnail": "https://image.com/photo.jpg",
        "slogan":"slogan"
    },
    {
        "userFollowing": [],
        "categoryFollowing": [],
        "categoryPublishing": [],
        "userId": 0,
        "publisher" : 1,
        "userName": "example_name2",
        "email": "hidden",
        "thumbnail": "https://image.com/photo.jpg",
        "slogan":"slogan"
    }
]

This endpoint retrieves all users and allows for search queries on users.

HTTP Request

GET https://peakapi.whitespell.com/users/

Query Parameters

Parameter Default Description Status
limit 50 If set, limit the amount of user objects you will get back by this amount. Tested
offset None If set, start loading from user ids only larger than the offset number (e.g. for infinite scrolling) Tested
userName None If set, will for users with a matching or semi-matching userName Not Started
bio None If set, will search for users with a matching or semi-matching bio Not Started
publisher None If set, will look for accounts only with certain publisher status. Not Started

Get a Specific User

curl "https://peakapi.whitespell.com/users/USER_ID" \
  -H "Authorization: YOUR_API_KEY" \
  -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY"

The above command returns JSON structured like this:

{
    "userFollowers": [],
    "userFollowing": [],
    "categoryFollowing": [],
    "categoryPublishing": [],
    "userId": 134,
    "publisher": 1,
    "userName": "pimdewitte",
    "email": "hidden",
    "thumbnail": "https://image.com/photo.jpg",
    "slogan":"slogan",
    "emailNotification":0,
    "subscriber":0
}

This endpoint retrieves information related to a unique user and allows for search queries on a unique user.

HTTP Request

GET https://peakapi.whitespell.com/users/USER_ID

Query Parameters

Parameter Default Description Status
includeFollowers 0 If value = 1, will include a JSON Array of userIds who are followers of this user. Tested
includeFollowing 0 If value = 1, will include a JSON Array of userIds this user is following. Tested
includeCategories 0 If value = 1, will include a JSON Array of categoryIds this user is following. Tested
includePublishing 0 If value = 1, will include a list of categoryIds this user is publishing in Tested

Create a New User

curl -d \ '{"userName":"YOUR_USERNAME","password":"YOUR_PASSWORD","email":"YOUR_EMAIL@EMAIL.COM", "publisher":1}' \
-H "Content-Type: application/json" \
-X POST "https://peakapi.whitespell.com/users" 

The above command returns JSON structured like this:

{
    "userId":11741,
    "publisher":1,
    "userName":"newPubUser2",
    "displayName":"",
    "email":"q2q@qq.com",
    "thumbnail":"",
    "coverPhoto":"",
    "slogan":""
}

This endpoint allows a new user to create their User Account, with or without publisher status.

HTTP Request

POST https://peakapi.whitespell.com/users/

POST Parameters

Parameter Required Description Status
userName Yes String(30) Tested
password Yes String(inf) Tested
email Yes String(45) Tested
publisher No BOOL (1 or 0) Tested

Update your User Profile

curl -d \ '{"userName":"YOUR_NEW_USERNAME","displayName":"DISPLAY_NAME","thumbnail":"https://newThumbUrl.com","cover_photo":"https://coverPhotoUrl.com","slogan":"slogan"}' \
-H "Content-Type: application/json" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/users/YOUR_USER_ID"

The above command returns JSON structured like this: Only updated fields are returned in the response, others are “” or [].

[
    {
    "userFollowing":[],
    "categoryFollowing":[],
    "categoryPublishing":[],
    "userId":1337,
    "userName":"YOUR_NEW_USERNAME",
    "displayName":"DISPLAY_NAME",
    "email":"",
    "thumbnail":"https://newThumbUrl.com",
    "coverPhoto":"https://coverPhotoUrl.com",
    "slogan":"slogan"
    }
]

This endpoint allows a user to update their user profile.

HTTP Request

POST https://peakapi.whitespell.com/users/YOUR_USER_ID

POST Parameters

Parameter Required Description Status
userName No String(30) Tested
displayName No String(30) Tested
thumbnail No String(255) Tested
coverPhoto No String(255) Tested
slogan No String(255) Tested

Update your User Settings

curl -d \ '{"password":"CURRENT_PASS","email":"email@email.com","newPassword":"NEW_PASS","publisher":PUBLISHER_NEW_VALUE}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/users/YOUR_USER_ID/settings"

The above command returns JSON structured like this: Only updated fields are returned in the response, others are “”.

[
    {
    "userId": 1,
    "publisher": 0,
    "email": "updated@email.com"
    }
]

This endpoint allows a user to update their user settings, where they can change their email, password and/or publisher status.

HTTP Request

POST https://peakapi.whitespell.com/users/USER_ID/settings

POST Parameters

Parameter Required Description Status
password Yes String(inf) Tested
email No String(45) Tested
newPassword No String(inf) Tested
publisher No BOOL (1 or 0) Tested

User Follow Action

curl -d \ '{"followingId":188,"action":"follow"}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/users/YOUR_USER_ID/following"

The above command returns JSON structured like this: Only updated fields are returned in the response, others are “”.

[
    {
        "action_taken"    :    "followed"
    }
]

This endpoint allows a user to follow another user.

HTTP Request

POST https://peakapi.whitespell.com/users/USER_ID/following

POST Parameters

Parameter Required Description Status
followingId Yes int(11) Tested
action Yes String, either follow/unfollow Tested

Request Following Categories

curl -d \ '{"userId":YOUR_USER_ID}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/users/YOUR_USER_ID/categories"

The above command returns JSON structured like this:

[
    {
        "categoryId" : 1,
        "categoryName" : "fitness"
    },
    {
        "categoryId" : 2,
        "categoryName" : "lacrosse"
    }
]

This endpoint returns the list of categories you are following.

HTTP Request

POST https://peakapi.whitespell.com/users/YOUR_USER_ID/categories

POST Parameters

Parameter Required Description Status
userId Yes int(11) Tested

Follow Category

curl -d \ '{"categoryId":CATEGORY_ID,"action":"follow"}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/users/YOUR_USER_ID/categories"

The above command returns JSON structured like this:

[
    {
        "action_taken"    :    "category_followed"
    }
]

This endpoint returns the list of categories you are following.

HTTP Request

POST https://peakapi.whitespell.com/users/YOUR_USER_ID/categories

POST Parameters

Parameter Required Description Status
categoryId Yes int(11) Tested
action Yes String (either follow/unfollow) Tested

Get Users by Category

curl "https://peakapi.whitespell.com/users/categories?categories=1" 

The above command returns JSON structured like this:

[
    {  
        "userId":134,
        "username":"pimdewitte",
        "thumbnail":"https://lh3.googleusercontent.com/-Sa9kdnhuE5E/AAAAAAAAAAI/AAAAAAAAABs/H8dhweNPuFI/photo.jpg",
        "categoryId":1
    },
    {  
        "userId":129,
        "username":"cyberstrike1",
        "thumbnail":"https://lh3.googleusercontent.com/-Sa9kdnhuE5E/AAAAAAAAAAI/AAAAAAAAABs/H8dhweNPuFI/photo.jpg",
        "categoryId":1
    }
]

This endpoint returns a list of users sorted by the categories you specify.

HTTP Request

GET https://peakapi.whitespell.com/users/categories

QUERY Parameters

Parameter Default Description Status
categories None Integer array of categories Tested
limit 50 If set, limit the amount of user objects you will get back by this amount. Tested
offset None If set, start loading from user ids only larger than the offset number (e.g. for infinite scrolling) Not Completed

Saved Content Action

curl -d \ '{"contentId":CONTENT_ID,"action":"save"}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/users/YOUR_USER_ID/saved"

The above command returns JSON structured like this:

[
    {
      "addedContentId" : 1111,
      "removedContentId" : -1,
      "success": true
    }
]

Requires authentication as the user.

This endpoint saves/unsaves the content to/from a user’s SavedContent list. Response will return -1 as default for the opposite action. If save, removedContentId = -1, if unsave, addedContentId = -1.

HTTP Request

POST https://peakapi.whitespell.com/users/YOUR_USER_ID/saved

POST Parameters

Parameter Required Description Status
contentId Yes int(11) Tested
action Yes String (either “save”/“unsave”) Tested

Get User Saved Content

curl "https://peakapi.whitespell.com/users/USER_ID/saved" \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" 

The above command returns JSON structured like this:

{
    "savedContent":[
        {
            "userId":134,
            "contentId":14131,
            "contentType":5,
            "categoryId":2,
            "contentTitle":"Introduction to Peak",
            "contentUrl":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl1080p":"https://s3.amazonaws.com/peak-users/vid/1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl720p":"https://s3.amazonaws.com/peak-users/vid/720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl480p":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl360p":"https://s3.amazonaws.com/peak-users/vid/360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl240p":"https://s3.amazonaws.com/peak-users/vid/240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentUrl144p":"https://s3.amazonaws.com/peak-users/vid/144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview1080p":"https://s3.amazonaws.com/peak-users/vid/preview-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview720p":"https://s3.amazonaws.com/peak-users/vid/preview-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview480p":"https://s3.amazonaws.com/peak-users/vid/preview-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview360p":"https://s3.amazonaws.com/peak-users/vid/preview-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview240p":"https://s3.amazonaws.com/peak-users/vid/preview-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "contentPreview144p":"https://s3.amazonaws.com/peak-users/vid/preview-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "thumbnail1080p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail720p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail480p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail360p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail240p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "thumbnail144p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
            "socialMediaVideo":"https://s3.amazonaws.com/peak-users/vid/sm-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
            "videoLengthSeconds":98,
            "contentDescription":"This is a simple intro to peak",
            "likes":5,
            "views":0,
            "thumbnailUrl":"http://res.cloudinary.com/whitespell-inc/image/upload/v1444240687/dzkpmk9k6jkxpfabprop.png",
            "userLiked":0,
            "userSaved":0,
            "userViewed":0,
            "contentPrice":0.0,
            "hasAccess":1,
            "recommended":0,
            "poster":{  
                "userId":134,
                "publisher":1,
                "emailVerified":0,
                "emailNotifications":0,
                "userName":"pimdewitte",
                "displayName":"pim de witte",
                "email":"pim@whitespell.com",
                "thumbnail":"http://peakapp.me/img/app_assets/avatar.png",
                "coverPhoto":"http://peakapp.me/img/app_assets/cover.png",
                "slogan":"peek-a-boo"
            },
            "children":[  ],
            "processed":1,
            "parent":0
        }
    ]
}

Requires authentication as the user. This endpoint returns the savedContent list for the given userId.

HTTP Request

GET https://peakapi.whitespell.com/users/USER_ID/saved

Update Email Verification Status

curl -d \ '{"userName":"username","emailToken":"EMAIL_TOKEN"}' \
-H "Content-Type: application/json" \
-X POST "https://peakapi.whitespell.com/users/email"

The above command returns JSON structured like this:

{
    "userId":-1,
    "publisher":0,
    "emailVerified":1,
    "userName":"USERNAME",
    "displayName":"",
    "email":"EMAIL",
    "thumbnail":"",
    "coverPhoto":"",
    "slogan":""
}

This endpoint is used to validate a user account with a valid email token on the web frontend.

HTTP Request

POST https://peakapi.whitespell.com/users/email

POST Parameters

Parameter Required Description Status
userName Yes String(45) Tested
emailToken Yes String(32) Tested

Resend Welcome Email (Email Verification)

curl -d \ {"email":"USER_EMAIL"}' \
-H "Content-Type: application/json" \
-X POST "https://peakapi.whitespell.com/users/resendemail"

The above command returns JSON structured like this:

{
    "success":true,
    "email":"USER_EMAIL"
}

This endpoint is used to resend a user’s welcome email. It resets their email verification status until they verify it through the web link provided in their email.

HTTP Request

POST https://peakapi.whitespell.com/users/resendemail

POST Parameters

Parameter Required Description Status
email Yes String(255) Tested

Get Email Verification Status

curl "https://peakapi.whitespell.com/users/USER_ID/email" \
-H "Content-Type: application/json" 

The above command returns JSON structured like this:

{
    "userId":11751,
    "emailVerified":0,
    "emailExpiration":"EXPIRATION_DATE"
}

This endpoint returns a user’s email verification status.

HTTP Request

GET https://peakapi.whitespell.com/users/USER_ID/email

Reset User Password

curl -d \ '{"userName":"username","newPassword":"newPass","resetToken":"EMAIL_TOKEN"}' \
-H "Content-Type: application/json" \
-X POST "https://peakapi.whitespell.com/users/reset"

The above command returns JSON structured like this:

{
    "success": true,
    "email":"USER_EMAIL"
}

This endpoint is used to reset a user’s password with a valid reset token on the web frontend.

HTTP Request

POST https://peakapi.whitespell.com/users/reset

POST Parameters

Parameter Required Description Status
userName Yes String(45) Tested
newPassword Yes String(inf) Tested
resetToken Yes String(32) Tested

Send Forgot Password Email

curl -d \ '{"userName":"username"}' \
-H "Content-Type: application/json" \
-X POST "https://peakapi.whitespell.com/users/forgot"

The above command returns JSON structured like this:

{
    "success": true,
    "email":"USER_EMAIL"
}

This endpoint sends a Forgot Password? email to the user’s email.

HTTP Request

POST https://peakapi.whitespell.com/users/forgot

POST Parameters

Parameter Required Description Status
userName Yes String(45) Tested

Facebook User Creation and Authentication

curl -d \ '{"accessToken":"FB_ACCESS_TOKEN","password":"PEAK_PASSWORD","deviceName":"DEVICE_NAME","deviceType":1,"deviceUUID":"DEVICE_TOKEN"}' \
-H "Content-Type: application/json" \
-X POST "https://peakapi.whitespell.com/users/facebook"

The above command returns JSON structured like this:

[
    {
        "key":"AUTH_KEY",
        "userId":117,
        "expires":-1
    }
]

This endpoint is used to create a new user or authenticate a current one with the Facebook login accessToken. Intended for use on client side after retrieving the Facebook access token from Facebook login in the client. If on a mobile client please include deviceName, deviceType and deviceUUID.

HTTP Request

POST https://peakapi.whitespell.com/users/facebook

POST Parameters

Parameter Required Description Status
accessToken Yes String(varchar), retrieved from client side facebook login Tested
password No String(inf), the user’s peak password Tested
deviceName No String(255), Name of device in settings, e.g. “Users Phone” Tested
deviceType No BOOL, 0 or 1, 0 for iOS devices, 1 for Android Tested
deviceUUID No String(255), the identifying device token for the device Tested

Add User Feedback for Peak

curl -d \ '{"email":"USER_EMAIL","message":"FEEDBACK_MESSAGE"}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/users/USER_ID/feedback"

The above command returns JSON structured like this:

[
    {
        "success":true
    }
]

Authentication as the User is Required

This endpoint is used to allow a user to add feedback for the app.

HTTP Request

POST https://peakapi.whitespell.com/users/USER_ID/feedback

POST Parameters

Parameter Required Description Status
email Yes String(255), the user’s email Tested
message Yes String(255), the user’s feedback message Tested

Add Reporting Type

curl -d \ '{"reportingTypeName":"REPORTING_TYPE_NAME"}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/users/reporting/types"

The above command returns JSON structured like this:

[
    {
        "reportingTypeAdded":true
    }
]

Authentication is Required

This endpoint adds a new reporting type (e.g. Vulgar comments or Fake profile picture) to the database.

HTTP Request

POST https://peakapi.whitespell.com/users/reporting/types

POST Parameters

Parameter Required Description Status
reportingTypeName Yes String(255), short description of why the user is being reported, to be shown in dropdown menu Tested

Request Reporting Types

curl "https://peakapi.whitespell.com/users/reporting/types" \
       -H "Authorization: YOUR_API_KEY" \
       -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" 

The above command returns JSON structured like this:

[  
    {  
        "reportingTypeId":4,
        "reportingTypeName":"Fake profile"
    },
    {  
        "reportingTypeId":1,
        "reportingTypeName":"Hate Speech or Attacking An Individual"
    }
]

Authentication is Required

This endpoint requests the reporting types that will be available for reporting a user endpoint (users/USER_ID/reporting).

HTTP Request

GET https://peakapi.whitespell.com/users/reporting/types

Report a User

curl -d \ '{"reportedUserId":"REPORTED_USER_ID","typeId":1,"message":"REPORTING_MESSAGE"}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/users/USER_ID/reporting"

The above command returns JSON structured like this:

[
    {
        "success":true
    }
]

Authentication is Required

This endpoint adds a new report on a user to the database.

HTTP Request

POST https://peakapi.whitespell.com/users/USER_ID/reporting/

POST Parameters

Parameter Required Description Status
reportedUserId Yes Int(11), the reported user’s userId Tested
typeId Yes Int(11), the id of the reporting type, get all reporting types with GET users/reporting/types Tested
message Yes String(255), user inputted message describing the reason for the report Tested

Get User Notifications

curl "https://peakapi.whitespell.com/users/USER_ID/notifications" \
       -H "Authorization: YOUR_API_KEY" \
       -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" 

The above command returns JSON structured like this:

{  
    "userNotifications":[  
        {  
            "userId":11896,
            "notificationText":"cory uploaded a new video!",
            "notificationAction":"open-content:14068",
            "notificationBadge":0,
            "notificationSound":0,
            "notificationStatus":1,
            "notificationImage":"THUMBNAIL_URL"
        },
        {  
            "userId":11896,
            "notificationText":"pim uploaded a new video!",
            "notificationAction":"open-content:14069",
            "notificationBadge":0,
            "notificationSound":0,
            "notificationStatus":1,
            "notificationImage":"THUMBNAIL_URL"
        }
    ]
}

Authentication as the user is Required

This endpoint requests all of the notifications that a user should have received. NotificationStatus is 0 when initialized, 1 on successful send, and should be set to 2 when read. (update notificationRead endpoint)

HTTP Request

GET https://peakapi.whitespell.com/users/USER_ID/notifications

QUERY Parameters

Parameter Default Description Status
limit 50 int(11) of the size of the notifications list. Tested
offset None int(11) of the minimum notificationId to request Tested

Update User Email Notification Status

curl -d \ '{"emailNotifications":0}' \
     -H "Content-Type: application/json" \
     -H "Authorization: YOUR_API_KEY" \
     -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
     -X POST "https://peakapi.whitespell.com/users/USER_ID/notifications"

The above command returns JSON structured like this: Only updated fields are returned in the response, others are “” or -1.

{
    "userId":1337,
    "publisher":-1,
    "emailVerified":-1,
    "emailNotifications":0,
    "userName":"USERNAME"
}   

Authentication as the user is Required

This endpoint modifies the user’s email notification status. Unchanged values are -1.

HTTP Request

POST https://peakapi.whitespell.com/users/USER_ID/notifications

QUERY Parameters

Parameter Default Description Status
emailNotifications None BOOL(1 or 0). 0 for no email notifications, 1 to allow them. Tested

Update User’s Access to Content

curl -d \ '{"contentId":0}' \
     -H "Content-Type: application/json" \
     -H "Authorization: YOUR_API_KEY" \
     -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
     -X POST "https://peakapi.whitespell.com/users/USER_ID/access"

The above command returns JSON structured like this:

{
    "success":true
}   

Authentication as the user is Required

This endpoint grants the user access to a content.

HTTP Request

POST https://peakapi.whitespell.com/users/USER_ID/access

QUERY Parameters

Parameter Default Description Status
contentId None Int(11). contentId the user will gain access to. Tested

Get Total Publisher Views

curl "https://peakapi.whitespell.com/users/USER_ID/views" \
       -H "Authorization: YOUR_API_KEY" \
       -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" 

The above command returns JSON structured like this:

{  
    "totalViews":1000
}

Authentication as the user is Required

This endpoint returns all the views a publisher has gotten on their published content.

HTTP Request

GET https://peakapi.whitespell.com/users/USER_ID/views

Delete a User

curl \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X DELETE "https://peakapi.whitespell.com/users/USER_ID"

The above command returns JSON structured like this:

[
    {
        "success"    :    true
    }
]

Requires authentication as the user

This endpoint allows a user to delete their Peak user account. Not reversible.

HTTP Request

DELETE https://peakapi.whitespell.com/users/USER_ID

Content

Request Content

curl "https://peakapi.whitespell.com/content" \
       -H "Authorization: YOUR_API_KEY" \
       -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \

The above command returns JSON structured like this:

[
    {
        "userId":134,
        "contentId":14131,
        "contentType":5,
        "categoryId":2,
        "contentTitle":"Introduction to Peak",
        "contentUrl":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "contentUrl1080p":"https://s3.amazonaws.com/peak-users/vid/1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "contentUrl720p":"https://s3.amazonaws.com/peak-users/vid/720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "contentUrl480p":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "contentUrl360p":"https://s3.amazonaws.com/peak-users/vid/360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "contentUrl240p":"https://s3.amazonaws.com/peak-users/vid/240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "contentUrl144p":"https://s3.amazonaws.com/peak-users/vid/144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "contentPreview1080p":"https://s3.amazonaws.com/peak-users/vid/preview-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "contentPreview720p":"https://s3.amazonaws.com/peak-users/vid/preview-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "contentPreview480p":"https://s3.amazonaws.com/peak-users/vid/preview-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "contentPreview360p":"https://s3.amazonaws.com/peak-users/vid/preview-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "contentPreview240p":"https://s3.amazonaws.com/peak-users/vid/preview-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "contentPreview144p":"https://s3.amazonaws.com/peak-users/vid/preview-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "thumbnail1080p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
        "thumbnail720p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
        "thumbnail480p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
        "thumbnail360p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
        "thumbnail240p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
        "thumbnail144p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
        "socialMediaVideo":"https://s3.amazonaws.com/peak-users/vid/sm-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
        "videoLengthSeconds":98,
        "contentDescription":"This is a simple intro to peak",
        "likes":5,
        "views":0,
        "thumbnailUrl":"http://res.cloudinary.com/whitespell-inc/image/upload/v1444240687/dzkpmk9k6jkxpfabprop.png",
        "userLiked":0,
        "userSaved":0,
        "userViewed":0,
        "contentPrice":0.0,
        "hasAccess":1,
        "recommended":0,
        "poster":{
            "userId":11863,
            "publisher":0,
            "emailVerified":0,
            "emailNotifications":0,
            "userName":"peakyoga",
            "thumbnail":"http://peakapp.me/img/app_assets/avatar.png"
        },
        "children":[
            {
                "userId":134,
                "contentId":14131,
                "contentType":5,
                "categoryId":2,
                "contentTitle":"Introduction to Peak",
                "contentUrl":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "contentUrl1080p":"https://s3.amazonaws.com/peak-users/vid/1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "contentUrl720p":"https://s3.amazonaws.com/peak-users/vid/720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "contentUrl480p":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "contentUrl360p":"https://s3.amazonaws.com/peak-users/vid/360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "contentUrl240p":"https://s3.amazonaws.com/peak-users/vid/240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "contentUrl144p":"https://s3.amazonaws.com/peak-users/vid/144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "contentPreview1080p":"https://s3.amazonaws.com/peak-users/vid/preview-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "contentPreview720p":"https://s3.amazonaws.com/peak-users/vid/preview-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "contentPreview480p":"https://s3.amazonaws.com/peak-users/vid/preview-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "contentPreview360p":"https://s3.amazonaws.com/peak-users/vid/preview-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "contentPreview240p":"https://s3.amazonaws.com/peak-users/vid/preview-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "contentPreview144p":"https://s3.amazonaws.com/peak-users/vid/preview-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "thumbnail1080p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
                "thumbnail720p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
                "thumbnail480p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
                "thumbnail360p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
                "thumbnail240p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
                "thumbnail144p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
                "socialMediaVideo":"https://s3.amazonaws.com/peak-users/vid/sm-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
                "videoLengthSeconds":98,
                "contentDescription":"This is a simple intro to peak",
                "likes":5,
                "views":0,
                "thumbnailUrl":"http://res.cloudinary.com/whitespell-inc/image/upload/v1444240687/dzkpmk9k6jkxpfabprop.png",
                "userLiked":0,
                "userSaved":0,
                "userViewed":0,
                "contentPrice":0.0,
                "hasAccess":1,
                "recommended":0,
                "poster":{  
                    "userId":134,
                    "publisher":1,
                    "emailVerified":0,
                    "emailNotifications":0,
                    "userName":"pimdewitte",
                    "displayName":"pim de witte",
                    "email":"pim@whitespell.com",
                    "thumbnail":"http://peakapp.me/img/app_assets/avatar.png",
                    "coverPhoto":"http://peakapp.me/img/app_assets/cover.png",
                    "slogan":"peek-a-boo"
                },
                "children":[  ],
                "processed":1,
                "parent":0
            }
        ],
        "processed":1,
        "parent":0
    }
]

Authentication as the requesting user is required

This endpoint requests the content in the database, can be user specific (?userId=USER_ID), contentId specific (?contentId=CONTENT_ID), contentType specific (?contentType=CONTENT_TYPE) or category specific (?categoryId=CATEGORY_ID).

userLiked refers to whether the authenticated user liked the given content. (1 authenticated user has liked it, 0 authenticated user has not liked it), recommended only applies to the newsfeed. hasAccess is 0 when the user needs to purchase content to view it, 1 when the content is free or purchased.

HTTP Request

GET https://peakapi.whitespell.com/content

QUERY Parameters

Parameter Default Description Status
userId None int(11), use this to search for content posted by a specific userId. Tested
contentId None int(11), use this to search for content with a specific contentId. Tested
contentType None int(11), use this to search for content of a certain contentType. e.g. contentType=6 for bundles Tested
categoryId None int(2), use this to search for content posted within a certain category. Tested
limit 50 int(11) of the size of the content you’d like to see. E.g. 25 for 25 videos. Tested
offset None int(11) of the minimum video ID to request (e.g. when you already have content, the last content id you have is the offset). Tested

Add Content

curl -d \ '{"categoryId":1,"contentType":CONTENT_TYPE,"contentTitle":"CONTENT_TITLE","contentUrl":"CONTENT_URL","contentDescription":"DESCRIPTION","thumbnailUrl":"thumburl.com","contentPrice":0.99}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/content"

The above command returns JSON structured like this:

[
    {
    "contentAdded":true,
    "contentId":"CONTENT_ADDED_ID"
    }
]

This endpoint allows a user to add content to the database.

HTTP Request

POST https://peakapi.whitespell.com/users/USER_ID/content

POST Parameters

Parameter Required Description Status
categoryId Yes int, Numeric value of the category (find all categories on GET /categories) Tested
contentType Yes int, Numeric value of the content type (find all content types on GET /content/types) Tested
contentTitle Yes String(45) Tested
contentUrl Yes String(255) Tested
contentDescription Yes String(100) Tested
contentPrice Yes Double(10,2) Tested
thumbnailUrl Yes String(255) Tested

Request Content Types

curl "https://peakapi.whitespell.com/content/types" \
       -H "Authorization: YOUR_API_KEY" \
       -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY"

The above command returns JSON structured like this:

[
     {
        "contentTypeId" : 1,
        "contentTypeName" : "youtube"
     }
]

This endpoint requests all the content types.

HTTP Request

GET https://peakapi.whitespell.com/content/types

Add ContentType

curl -d \ '{"contentTypeName":"CONTENT_TYPE_NAME"}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/content/types"

The above command returns JSON structured like this:

[
    {
            "content_type_added"    :    true
    }
]

This endpoint adds a content type such as youtubeVideo to the database. Avoid spaces.

HTTP Request

POST https://peakapi.whitespell.com/content/types

POST Parameters

Parameter Required Description Status
contentTypeName Yes String(45) Name of the added contentType. Avoid spaces. Tested

Get Comments on Content

curl "https://peakapi.whitespell.com/content/CONTENT_ID/comments" \
       -H "Authorization: YOUR_API_KEY" \
       -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY"

The above command returns JSON structured like this:

[
    {
        "commentId":91,
        "contentId":8420,
        "likes":0,
        "comment":"first comment",
        "timestamp":"Aug 6, 2015 5:08:16 PM",
        "poster":{
            "userId":272,
            "publisher":0,
            "emailVerified":0,
            "userName":"1337",
            "thumbnail":"http://wpidiots.com/html/writic/red-writic-template/css/img/demo-images/avatar1.jpg"
        }
    },
    {
        "commentId":92,
        "contentId":8420,
        "likes":0,
        "comment":"second comment",
        "timestamp":"Aug 6, 2015 5:08:23 PM",
        "poster":{
            "userId":272,
            "publisher":0,
            "emailVerified":0,
            "userName":"1337",
            "thumbnail":"http://wpidiots.com/html/writic/red-writic-template/css/img/demo-images/avatar1.jpg"
        }
    },
    {
        "commentId":93,
        "contentId":8420,
        "likes":0,
        "comment":"third comment",
        "timestamp":"Aug 6, 2015 5:08:28 PM",
        "poster":{
            "userId":272,
            "publisher":0,
            "emailVerified":0,
            "userName":"1337",
            "thumbnail":"http://wpidiots.com/html/writic/red-writic-template/css/img/demo-images/avatar1.jpg"
        }
    },
    {
        "commentId":94,
        "contentId":8420,
        "likes":0,
        "comment":"fourth comment",
        "timestamp":"Aug 6, 2015 5:08:33 PM",
        "poster":{
            "userId":272,
            "publisher":0,
            "emailVerified":0,
            "userName":"1337",
            "thumbnail":"http://wpidiots.com/html/writic/red-writic-template/css/img/demo-images/avatar1.jpg"
        }
    },
    {
        "commentId":95,
        "contentId":8420,
        "likes":0,
        "comment":"wow this video is awesome, love it!",
        "timestamp":"Aug 6, 2015 9:54:30 PM",
        "poster":{
            "userId":272,
            "publisher":0,
            "emailVerified":0,
            "userName":"1337",
            "thumbnail":"http://wpidiots.com/html/writic/red-writic-template/css/img/demo-images/avatar1.jpg"
        }
    }
]

Requires authentication as any user. This endpoint returns all the comments for the given contentId, sorted by date and time.

HTTP Request

GET https://peakapi.whitespell.com/content/CONTENT_ID/comments

Add Comment to Content

curl -d \ '{"userId":USER_ID,"comment":"COMMENT_VALUE"}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/content/CONTENT_ID/comments"

The above command returns JSON structured like this:

[
    {
            "commentAdded"    :    true
    }
]

Requires authentication as the user posting the comment. This endpoint adds a comment to the given contentId as the given userId.

HTTP Request

POST https://peakapi.whitespell.com/content/CONTENT_ID/comments

POST Parameters

Parameter Required Description Status
userId Yes int(11) Tested
comment Yes String(255) Tested

Content Like Action

curl -d \ '{"userId":188,"action":"like"}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/content/CONTENT_ID/likes"

The above command returns JSON structured like this:

[
    {
        "action_taken"    :    "like"
    }
]

This endpoint allows a user like/unlike content.

HTTP Request

POST https://peakapi.whitespell.com/content/CONTENT_ID/likes

POST Parameters

Parameter Required Description Status
userId Yes int(11), userId of user that is liking/unliking content Tested
action Yes String, either like/unlike Tested

Add Content to A Bundle

curl -d \ '{"childId":CHILD_ID}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/content/PARENT_CONTENT_ID/add_child"

The above command returns JSON structured like this:

[
    {
        "added_to_bundle":true
    }
]

This endpoint adds a child to a parent (bundle)

HTTP Request

POST https://peakapi.whitespell.com/content/PARENT_CONTENT_ID/add_child

POST Parameters

Parameter Required Description Status
childId Yes int(11), contentId of the parent content (bundle) Tested

Update Content

curl -d \ '{"userId":"UPLOADER_USER_ID","contentTitle":"CONTENT_TITLE","contentDescription":"CONTENT_DESCRIPTION","contentPrice":CONTENT_PRICE}' \
-H "Content-Type: application/json" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/content/CONTENT_ID"

The above command returns JSON structured like this: Only updated fields are returned in the response, others are “”, 0 or [].

{
    "userId":134,
    "contentId":14131,
    "contentType":5,
    "categoryId":2,
    "contentTitle":"Introduction to Peak",
    "contentUrl":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "contentUrl1080p":"https://s3.amazonaws.com/peak-users/vid/1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "contentUrl720p":"https://s3.amazonaws.com/peak-users/vid/720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "contentUrl480p":"https://s3.amazonaws.com/peak-users/vid/480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "contentUrl360p":"https://s3.amazonaws.com/peak-users/vid/360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "contentUrl240p":"https://s3.amazonaws.com/peak-users/vid/240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "contentUrl144p":"https://s3.amazonaws.com/peak-users/vid/144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "contentPreview1080p":"https://s3.amazonaws.com/peak-users/vid/preview-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "contentPreview720p":"https://s3.amazonaws.com/peak-users/vid/preview-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "contentPreview480p":"https://s3.amazonaws.com/peak-users/vid/preview-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "contentPreview360p":"https://s3.amazonaws.com/peak-users/vid/preview-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "contentPreview240p":"https://s3.amazonaws.com/peak-users/vid/preview-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "contentPreview144p":"https://s3.amazonaws.com/peak-users/vid/preview-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "thumbnail1080p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
    "thumbnail720p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-720p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
    "thumbnail480p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-480p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
    "thumbnail360p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-360p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
    "thumbnail240p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-240p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
    "thumbnail144p":"https://s3.amazonaws.com/peak-users/vid/thumbnail-144p-480p-134_2_1444240700.736662_Introduction_to_Peak.jpg",
    "socialMediaVideo":"https://s3.amazonaws.com/peak-users/vid/sm-1080p-480p-134_2_1444240700.736662_Introduction_to_Peak.mp4",
    "videoLengthSeconds":98,
    "contentDescription":"This is a simple intro to peak",
    "likes":5,
    "views":0,
    "thumbnailUrl":"http://res.cloudinary.com/whitespell-inc/image/upload/v1444240687/dzkpmk9k6jkxpfabprop.png",
    "userLiked":0,
    "userSaved":0,
    "userViewed":0,
    "contentPrice":0.0,
    "hasAccess":1,
    "recommended":0,
    "poster":{  
        "userId":134,
        "publisher":1,
        "emailVerified":0,
        "emailNotifications":0,
        "userName":"pimdewitte",
        "displayName":"pim de witte",
        "email":"pim@whitespell.com",
        "thumbnail":"http://peakapp.me/img/app_assets/avatar.png",
        "coverPhoto":"http://peakapp.me/img/app_assets/cover.png",
        "slogan":"peek-a-boo"
    },
    "children":[  ],
    "processed":1,
    "parent":0  
}

Requires authentication as the uploader

This endpoint allows a user to update their content.

HTTP Request

POST https://peakapi.whitespell.com/content/CONTENT_ID

POST Parameters

Parameter Required Description Status
userId Yes int(11) Tested
contentTitle No String(45) Tested
contentDescription No String(100) Tested
contentPrice No Double(10,2) Tested

Content View Action

curl -d \ '{"userId":188}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/content/CONTENT_ID/views"

The above command returns JSON structured like this:

[
    {
        "success"    :    true
    }
]

This endpoint allows a user like/unlike content.

HTTP Request

POST https://peakapi.whitespell.com/content/CONTENT_ID/views

POST Parameters

Parameter Required Description Status
userId Yes int(11), userId of user that is viewing the content Tested

Delete Content

curl \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X DELETE "https://peakapi.whitespell.com/content/CONTENT_ID"

The above command returns JSON structured like this:

[
    {
        "success"    :    true
    }
]

Requires authentication as the publisher

This endpoint allows a publisher to delete uploaded content (and the video/thumbnails).

HTTP Request

DELETE https://peakapi.whitespell.com/content/CONTENT_ID

Delete a Comment

curl \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X DELETE "https://peakapi.whitespell.com/comments/COMMENT_ID"

The above command returns JSON structured like this:

[
    {
        "success"    :    true
    }
]

Requires authentication as the comment poster

This endpoint allows a user to delete a comment they posted.

HTTP Request

DELETE https://peakapi.whitespell.com/comments/COMMENT_ID

Categories

Request Categories

curl "https://peakapi.whitespell.com/categories"

The above command returns JSON structured like this:

[
    {
        "categoryId":1,
        "categoryName":"basketball",
        "categoryThumbnail":"http://www.dhresource.com/albu_355597555_00/1.0x0.jpg",
        "categoryFollowers":12,
        "categoryPublishers":3
    },
    {
        "categoryId":2,
        "categoryName":"fitness",
        "categoryThumbnail":"https://encrypted-tbn2.gstatic.com/images?q\u003dtbn:ANd9GcSARlNn_7bqIDtOekrGQyloJOLaoHaBNvOOUMdeXoSTFXviLXHT",
        "categoryFollowers":61,
        "categoryPublishers":0
    }
]

This endpoint requests all current categories in the database.

HTTP Request

GET https://peakapi.whitespell.com/categories

Add a Category

curl -d \ '{"categoryName":"CATEGORY_NAME","categoryThumbnail":"CATEGORY_THUMB_URL"}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/content/categories"

The above command returns JSON structured like this:

[
    {
        "category_added":true
    }
]

This endpoint adds a category to the list of categories.

HTTP Request

POST https://peakapi.whitespell.com/categories

POST Parameters

Parameter Required Description Status
categoryName Yes String(25) Maximum 10 categories. Tested
categoryThumbnail Yes String(255) Tested

Orders

Create an Order

curl -d \ '{"orderUUID":"ORDER_UUID","orderType":1,"publisherId":134,"buyerId":1337,"contentId":1111,"orderOriginId":1,"orderPayload":"LONG_STRING"}' \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY" \
-X POST "https://peakapi.whitespell.com/users/USER_ID/order"

The above command returns JSON structured like this:

[
    {
        "orderType" : 1,
        "success"    :    true
    }
]

This endpoint is used to create an order in the database for a user’s bundle purchase or subscription.

HTTP Request

POST https://peakapi.whitespell.com/users/USER_ID/order

POST Parameters

Parameter Required Description Status
orderType Yes int(11), 1 for bundle, 2 for subscription Tested
buyerId Yes int(11), userId of the buyer of this content/subscription Tested
orderOriginId Yes int(11), 1 for ApplePay, 2 for GooglePlay, 3 for Web based order Tested
publisherId No int(11), userId of the publisher of this content, not required for subscription Tested
contentId No int(11), contentId of purchased bundle, (used for google and web) not required for subscription Tested
orderPayload No String(Unlimited), only needed for apple purchase, used to get transaction information Tested
productId No String(255), only needed for google purchase, used to get transaction information Tested
purchaseToken No String(Unlimited), only needed for google and web purchase, used to get transaction information Tested
orderUUID No String(Unlimited), only needed for google purchase, used to store transaction information Tested

Get an Order

curl "https://peakapi.whitespell.com/users/USER_ID/order" \
  -H "X-Authentication: YOUR_USER_ID,YOUR_AUTH_KEY"

The above command returns JSON structured like this:

[
  {
     "orderId":2,
     "orderUUID":"27614847GDgvc.231234441",
     "orderType":"bundle",
     "orderStatus":"success",
     "orderOrigin":"apple",
     "publisherId":11989,
     "buyerId":11990,
     "contentId":14267,
     "emailSent":0,
     "delivered":0
  },
  {
     "orderId":3,
     "orderUUID":"27614847GDgvc3123123.1",
     "orderType":"subscription",
     "orderStatus":"success",
     "orderOrigin":"google",
     "publisherId":-1,
     "buyerId":11990,
     "contentId":-1,
     "emailSent":0,
     "delivered":0
  }
]

This endpoint is used to get all orders for a user, bundles and subscriptions.

HTTP Request

GET https://peakapi.whitespell.com/users/USER_ID/order