Pagination

This pagination take two parameters, page and per_page. page argument is the number of the page to get and per_page is the number of the items per page.
The number per page default value is 50, you can up to 100 items per page.

varKinowSDK=require('kinow-javascript-sdk')varapiCustomers=newKinowSDK.CustomersApi()apiCustomers.getCustomers().then(data=>console.log('API called successfully. Returned data: '+data)).catch(e=>console.log(e))

All requests you send at api.kinow.com must have an http header Authorization containing the token type and the token access.

If token is missing or incorrect, a 403 error will be returned.

Make sure to replace YOUR_ACCESS_TOKEN with the access_token given by the previous step.

STEP 3 - Customer registration

Now we will see how to register a customer using the API.

Fetch coutries

First, we fetch all the countries to create select field to pick the correct id country.

STEP 8 - Get video player

Check customer accesses

Before getting video player, we must check if customer has access to this video. To do this we will call /customers/{customer_id}/videos/{video_id}/has-access width customer_id and video_id as parameters

At this step, we just have the customer id and the product id, we must fetch the video id.

Get video id

Videos are attached to a product. To get videos, we will call /products/{product_id}/videos with product_id as parameter.

constapiVideos=newKinowSDK.VideosApi()// Optionalvaroptions={customerId:customer.id,// Customer ID to use in video analytics (optional)countryId:customer.id_country// Country ID to use in video analytics (optional)}apiVideos.getVideoPlayer(video.id,options).then(data=>console.log(data)).catch(e=>console.log(e))