ballerinax/spotify Ballerina library

1.5.2

Overview

The Spotify API v1 connector(https://developer.spotify.com/documentation/web-api/) OpenAPI Specification.

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

Key Features

  • Programmatic access to create and manage resources via REST API
  • Access analytics, reports, and performance metrics
  • Manage user accounts and profiles
  • Secure authentication with API key or OAuth support

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

Other versions

See more...

Metadata

Released date: 3 days ago

Version: 1.5.2

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.8.0

GraalVM compatible: Yes


Pull count

Total: 2283

Current verison: 0


Weekly downloads


Source repository


Keywords

Type/Connector

Vendor/Spotify

Area/Storage & File Management

Content & Files/Video & Audio

Cost/Freemium


Contributors