ballerinax/instagram Ballerina library

1.5.1

Overview

This is a generated connector for Instagram Basic Display API v12.0 OpenAPI specification.

Instagram is a free photo-sharing application that enables its users to take photos, apply filters, and share them on social networks. The Instagram Basic Display API allows users of your app to get basic profile information, photos, and videos in their Instagram accounts.

Prerequisites

Before using this connector in your Ballerina application, complete the following:

Quickstart

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

Step 1: Import connector

First, import the ballerinax/instagram module into the Ballerina project.

Copy
import ballerinax/instagram;

Step 2: Create a new connector instance

Create a instagram:ApiKeysConfig with the <ACCESS_TOKEN> obtained, and initialize the connector with it.

Copy
instagram:ApiKeysConfig apiKeyConfig = {
    accessToken = "<ACCESS_TOKEN>"
};

instagram:Client baseClient = check new Client(apiKeyConfig);

Step 3: Invoke connector operation

  1. Now you can use the operations available within the connector. Note that they are in the form of remote operations.

    Following is an example to get fields of a image, video, or album using the connector.

    Copy
    public function main() {
        string[] fields = ["id","username"];
        string mediaId = "2684065555656187876_50003825255";
    
        instagram:MediaFieldsObject|error result = baseClient->getMedia(mediaId, fields);
        if (result is instagram:MediaFieldsObject) {
            log:printInfo(result.toString());
        } else {
            log:printInfo(result.toString());
        }
    }
  2. Use bal run command to compile and run the Ballerina program.

Import

import ballerinax/instagram;Copy

Metadata

Released date: over 1 year ago

Version: 1.5.1

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.4.1

GraalVM compatible: Yes


Pull count

Total: 1

Current verison: 1


Weekly downloads


Source repository


Keywords

Marketing/Social Media Accounts

Cost/Free


Contributors

Other versions