Skilvul Public API (1.0.0)

Access Tokens

To retrieve an access token, POST a clientId/clientSecret combination to /v1/oauth/token.

For example:

curl -X POST 'https://public.api.skilvul.com/v1/oauth/token' -d "clientId=YOUR_CLIENT_ID&clientSecret=YOUR_CLIENT_SECRET"

returns a response like:

{
    "tokenType": "Bearer",
    "accessToken": "aa9f3cdb7c5359d3621e58ee59c7feb31ec03da818d9a8dd939f3a8eff15e140",
    "accessTokenExpiresAt": 1587448713231,
    "refreshToken": "3fd78bb5eb4ce238701e16309e0c6f7d15d2b09bab40d3a7dd2eb4dd74d3dffr",
    "refreshTokenExpiresAt": 1587448713231,
    "error": null
}

Token Expiration

Access tokens will expire, if an expired token is used a 403 status code will be returned. The refresh token can be used to automatically renew an access token without requiring the password again (as long as the refresh token used is also not yet expired).

For example:

curl -X POST 'https://public.api.skilvul.com/v1/oauth/token/refresh' -d "clientId=YOUR_CLIENT_ID&refreshToken=YOUR_REFRESH_TOKEN"

If the refresh token has expired, you will need to generate a new one using /v1/oauth/token.

Authentication

Authenticate requests by including an Authorization header of type Bearer.

For example:

curl 'https://public.api.skilvul.com/v1/products' -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

/v1/oauth

Request new access/refresh tokens

Request Body schema: application/json
required
clientId
required
string

The Client ID provided by Skilvul.

clientSecret
required
string

The Client Secret provided by Skilvul.

Responses

Request samples

Content type
application/json
{
  • "clientId": "YOUR_CLIENT_ID",
  • "clientSecret": "YOUR_CLIENT_SECRET"
}

Response samples

Content type
application/json
{
  • "tokenType": "Bearer",
  • "accessToken": "aa9f3cdb7c5359d3621e58ee59c7feb31ec03da818d9a8dd939f3a8eff15e140",
  • "accessTokenExpiresAt": 1587448713231,
  • "refreshToken": "3fd78bb5eb4ce238701e16309e0c6f7d15d2b09bab40d3a7dd2eb4dd74d3dffr",
  • "refreshTokenExpiresAt": 1587967113231,
  • "error": null
}

Renew access token

Request Body schema: application/json
required
clientId
required
string

The Client ID provided by Skilvul.

refreshToken
required
string

The refresh token generated from /v1/oauth/token.

Responses

Request samples

Content type
application/json
{
  • "clientId": "YOUR_CLIENT_ID",
  • "refreshToken": "YOUR_REFRESH_TOKEN"
}

Response samples

Content type
application/json
{
  • "tokenType": "Bearer",
  • "accessToken": "aa9f3cdb7c5359d3621e58ee59c7feb31ec03da818d9a8dd939f3a8eff15e140",
  • "accessTokenExpiresAt": 1587448713231,
  • "error": null
}

/v1/bundles

Get a list of Bundles

Authorizations:
bearerAuth
query Parameters
limit
integer
Default: 10
offset
integer

Responses

Response samples

Content type
application/json
{
  • "bundles": [
    ],
  • "totalBundles": 1,
  • "error": null
}

Get total Bundle count

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "count": 1,
  • "error": null
}

Get a single Bundle

Authorizations:
bearerAuth
path Parameters
bundleId
required
string

Responses

Response samples

Content type
application/json
{
  • "bundle": {
    },
  • "error": null
}

Check whether or not a User has Purchased a Bundle

Authorizations:
bearerAuth
path Parameters
bundleId
required
string
query Parameters
email
required
string

Responses

Response samples

Content type
application/json
{
  • "canBuy": true,
  • "error": null
}

/v1/products

Get a list of Products

Authorizations:
bearerAuth
query Parameters
limit
integer
Default: 10
offset
integer

Responses

Response samples

Content type
application/json
{
  • "products": [
    ],
  • "totalProducts": 1,
  • "error": null
}

Get total Product count

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "count": 1,
  • "error": null
}

Get a single Product

Authorizations:
bearerAuth
path Parameters
productId
required
string

Responses

Response samples

Content type
application/json
{
  • "product": {
    },
  • "error": null
}

Check whether or not a User has Purchased a Product

Authorizations:
bearerAuth
path Parameters
productId
required
string
query Parameters
email
required
string

Responses

Response samples

Content type
application/json
{
  • "canBuy": true,
  • "error": null
}

/v1/addons

Get a single Add-on

Authorizations:
bearerAuth
path Parameters
addOnId
required
string

Responses

Response samples

Content type
application/json
{}

Check whether or not a User has Purchased a Add-on

Authorizations:
bearerAuth
path Parameters
addOnId
required
string
query Parameters
email
required
string

Responses

Response samples

Content type
application/json
{
  • "canBuy": true,
  • "error": null
}

/v1/orders

Create a new Order

Authorizations:
bearerAuth
Request Body schema: application/json
required
required
object
bundleIds
Array of strings

List of Bundle Ids to be purchased.

productIds
Array of strings

List of Product Ids to be purchased.

addOnIds
Array of strings

List of Add-on Ids to be purchased.

Responses

Request samples

Content type
application/json
{
  • "user": {
    },
  • "bundleIds": [
    ],
  • "productIds": [
    ],
  • "addOnIds": [
    ]
}

Response samples

Content type
application/json
{
  • "user": {
    },
  • "order": {
    },
  • "error": null,
  • "errorBundleIds": [ ],
  • "errorProductIds": [ ],
  • "errorAddOnIds": [ ]
}

Validate Order

Authorizations:
bearerAuth
Request Body schema: application/json
required
required
object
bundleIds
Array of strings

List of Bundle Ids to be purchased.

productIds
Array of strings

List of Product Ids to be purchased.

addOnIds
Array of strings

List of Add-on Ids to be purchased.

Responses

Request samples

Content type
application/json
{
  • "user": {
    },
  • "bundleIds": [
    ],
  • "productIds": [
    ],
  • "addOnIds": [
    ]
}

Response samples

Content type
application/json
{
  • "user": {
    },
  • "error": null,
  • "errorBundleIds": [ ],
  • "errorProductIds": [ ],
  • "errorAddOnIds": [ ]
}

/v1/provinces

Get a list of Provinces

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "provinces": [
    ],
  • "totalProvinces": 1,
  • "error": null
}

Get a single Province

Authorizations:
bearerAuth
path Parameters
provinceId
required
string

Responses

Response samples

Content type
application/json
{
  • "province": {
    },
  • "error": null
}

/v1/cities

Get a list of Cities

Authorizations:
bearerAuth
query Parameters
provinceId
required
string

Responses

Response samples

Content type
application/json
{
  • "cities": [
    ],
  • "totalCities": 1,
  • "error": null
}

Get a single City

Authorizations:
bearerAuth
path Parameters
cityId
required
string

Responses

Response samples

Content type
application/json
{
  • "city": {
    },
  • "error": null
}

/v1/professions

Get a list of Professions

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "professions": [
    ],
  • "totalProfessions": 1,
  • "error": null
}

/v1/schools

Get a list of School Grades

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "schoolGrades": [
    ],
  • "totalSchoolGrades": 1,
  • "error": null
}

Get a list of School Types

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "schoolTypes": [
    ],
  • "totalSchoolTypes": 1,
  • "error": null
}

Get a list of Schools

Authorizations:
bearerAuth
query Parameters
schoolGradeId
required
string
schoolTypeId
string
provinceId
required
string
cityId
string
search
string

Responses

Response samples

Content type
application/json
{
  • "schools": [
    ],
  • "totalSchools": 1,
  • "error": null
}

/v1/users

Get a single User

Authorizations:
bearerAuth
path Parameters
userId
required
string

Responses

Response samples

Content type
application/json
{
  • "user": {
    },
  • "error": null
}

Update a User

Authorizations:
bearerAuth
path Parameters
userId
required
string
Request Body schema: application/json
required
firstName
string
lastName
string
gender
string
Enum: "MALE" "FEMALE" "NOT_SPECIFIED"
birthPlace
string
birthDate
string
provinceId
string

Required if cityId is not null.

cityId
string

Required if provinceId is not null.

profession
string
schoolId
string
otherSchoolName
string or null
Value: null

If schoolId is not null, otherSchoolName will be ignored

schoolGradeId
string

Required if schoolId or otherSchoolName is not null.

schoolTypeId
string
schoolProvinceId
string

Required if schoolId or otherSchoolName is not null.

schoolCityId
string

Responses

Request samples

Content type
application/json
{
  • "firstName": "John",
  • "lastName": "Doe",
  • "gender": "MALE",
  • "birthPlace": "Indonesia",
  • "birthDate": "2020-11-10T00:00:00.000Z",
  • "provinceId": "ck108q0se017c0715zfh68162",
  • "cityId": "ck108q0se017c0715zfh68162",
  • "profession": "Pelajar (SMP)",
  • "schoolId": "ck108q0se017c0715zfh68162",
  • "otherSchoolName": null,
  • "schoolGradeId": "ck108q0se017c0715zfh68162",
  • "schoolTypeId": "ck108q0se017c0715zfh68162",
  • "schoolProvinceId": "ck108q0se017c0715zfh68162",
  • "schoolCityId": "ck108q0se017c0715zfh68162"
}

Response samples

Content type
application/json
{
  • "user": {
    },
  • "error": null
}

Resend email verification to User

Authorizations:
bearerAuth
path Parameters
userId
required
string

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "error": null
}

Logout User

Authorizations:
bearerAuth
path Parameters
userId
required
string

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "error": null
}