ballerinax/spotify Ballerina library

1.5.1

Overview

This is a generated connector from Spotify API v1 OpenAPI Specification.

Through the Spotify Web API, external applications retrieve Spotify content such as album data and playlists.

Configuring connector

Prerequisites

  • Create Spotify user account by simply signing up at www.spotify.com.
  • Obtain tokens
    • Visit the Dashboard page at the Spotify Developer website and, if necessary, log in. Accept the latest Developer Terms of Service to complete your account set up.
    • Follow the steps that are given in [here](Web API authentication visit here) to obtain tokens.

Quickstart

To use the Spotify connector in your Ballerina application, update the .bal file as follows:

Step 1: Import connector

Copy
import ballerinax/spotify;

Step 2: Create a new connector instance

Configure the connection using OAuth2 refresh token grant config.

Copy
spotify:Configuration configuration = {
    auth: {
        refreshUrl: "https://accounts.spotify.com/api/token",
        refreshToken : "<REFRESH_TOKEN>",
        clientId : "<CLIENT_ID>",
        clientSecret : "<CLIENT_SECRET>"
    }
};

spotify:Client spotifyClient = check new (configuration);

Step 3: Invoke connector operation

  1. Get list newly released albums in spotify.
Copy
public function main() returns error? {
    spotify:NewReleasesObject newReleases = check spotifyClient->getNewReleses();
}
  1. Use bal run command to compile and run the Ballerina program.

Import

import ballerinax/spotify;Copy

Metadata

Released date: 12 months ago

Version: 1.5.1

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.4.1

GraalVM compatible: Yes


Pull count

Total: 1913

Current verison: 247


Weekly downloads


Source repository


Keywords

Content & Files/Video & Audio

Cost/Freemium


Contributors

Other versions

See more...