API Documentation

March 28, 2020 • By sCloud

Upgrades now only $10.87 for 12 months - limited time only.

We have made our Api simple to understand and have also provided usage examples in various programming languages to help developers explore them.
sCloud Api uses the {JSON} Protocol that returns JSON-encoded responses and uses standard HTTP response codes, authentication.

This first section describes connecting to the API with endpoints and then also how to connect using the SDK and also non SDK examples.
If you prefer to not use the endpoints directly you can jump straight in using a ready made Library/SDK

Endpoint https://scloud.live/Apiv1/Cloud

You need to register your app in the developers console before you can use the API.

1. User authentication and authorizing your app

sCloud uses OAuth 2.0 for API authentication, authorization and to generate access tokens.

Authorization flow

  • web flow
  • code flow
  • web flow

    GET https://api.scloud.live/oauth2?client_id={client_id}&scope={scope}
    &response_type=token&redirect_uri={redirect_uri}

    code flow

    GET https://api.scloud.live/oauth2?client_id={client_id}&scope={scope}
    &response_type=token&redirect_uri={redirect_uri}


    Once your app is authorized and has received an access token, it can then make requests to the sCloud endpoint.

    curl -X POST "https://scloud.live/Apiv1/Cloud" \
    --header "Authorization: Bearer < OAUTH2_ACCESS_TOKEN >"



    2. Call Requests

    A simple JSON API call:

    [Cloud]
    Raw JSON response - Example
    cloud":
    { "storage_used":"132GB",
    "Video":[["example.pm4",
    "example2.mp4","example4.mp4","example5.mp4","..."]]
    "Images":[["1.jpg","2.JPG","3.JPG","4.JPG"]]
    }"

    simple example using (php) file_get_contents($url)
    the $json_data array will contain all information relating to the account
    connected to the access key.

    Example using our SDK


    [Cloud] resource
    php javascript ajax java
    $url = "https://scloud.live/Apiv1/API.php?api_key=26ba6ba27725kj";
    $json = file_get_contents($url);
    $json_data = json_decode($json, true);
    //print_r($json_data);


    $storage_used=$json_data[cloud][storage_used];
    //echo $storage_used;

    //or

    //array containing File Names of videos in the Videos folder
    $videos=$json_data[cloud]['videos'];
    print_r($videos);


    for example you can get the 22nd file by using
    php javascript ajax java
    $json_data[cloud][Images][0][22];

    OUTPUT:
    suncloudinthesky.png


    Account - Accessing Account information


    To access account related information you could do this
    copy | php javascript ajax java
    $json_data[account][username];
    $json_data[account][email];//will be obsolete in the future
    $json_data[account][account_type];//free or premium $json_data[account][creation_date];//date account was created

    What are you waiting for? download now