Disqus

Disqus

  • Category: Social


Introduction to Disqus API

Disqus API provides programmatic access to the Disqus comments platform. The authentication process is required to access the API and generate an access token which can be used to make requests to the API.

In this article, we will cover the authentication process and provide examples of using Disqus API using JavaScript.

Authentication

To use the Disqus API, you need to authenticate yourself by obtaining an access token. To get the access token, follow these steps:

  1. Create a Disqus account if you don't have one already.
  2. Log in to your Disqus account.
  3. Go to the applications page.
  4. Click on the "Create New Application" button.
  5. Fill in the form with the necessary information (e.g., the name of your application, the category, the description, etc.).
  6. Click the "Create Application" button.
  7. Click on the "Details" link to view the details of the application.
  8. The "Public Key" and "Secret Key" will be listed on that page. You will need to use these keys to generate a token.

Here is an example of how to generate an access token using JavaScript:

var public_key = 'your_public_key';
var secret_key = 'your_secret_key';

var url = 'https://disqus.com/api/oauth/2.0/access_token/';

var xhr = new XMLHttpRequest();
xhr.open('POST', url);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function() {
  if (xhr.status === 200) {
    var response = JSON.parse(xhr.responseText);
    var access_token = response.access_token;
    console.log('Access Token:', access_token);
  } else {
    console.log('Error:', xhr.statusText);
  }
};
xhr.send('grant_type=client_credentials&client_id=' + public_key + '&client_secret=' + secret_key);

Disqus API Examples

Once you have generated an access token, you can start using the Disqus API. Here are some examples:

List Forums

var access_token = 'your_access_token';

var url = 'https://disqus.com/api/3.0/forums/list.json?access_token=' + access_token;

var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.onload = function() {
  if (xhr.status === 200) {
    var response = JSON.parse(xhr.responseText);
    console.log('Forums:', response.response);
  } else {
    console.log('Error:', xhr.statusText);
  }
};
xhr.send();

Update Forum

var access_token = 'your_access_token';
var forum_id = 'your_forum_id';
var forum_name = 'new_forum_name';

var url = 'https://disqus.com/api/3.0/forums/update.json?access_token=' + access_token +
          '&forum=' + forum_id + '&name=' + forum_name;

var xhr = new XMLHttpRequest();
xhr.open('POST', url);
xhr.onload = function() {
  if (xhr.status === 200) {
    var response = JSON.parse(xhr.responseText);
    console.log('Forum Updated:', response.response);
  } else {
    console.log('Error:', xhr.statusText);
  }
};
xhr.send();

Create Category

var access_token = 'your_access_token';
var forum_id = 'your_forum_id';
var category_name = 'new_category';

var url = 'https://disqus.com/api/3.0/categories/create.json?access_token=' + access_token +
          '&forum=' + forum_id + '&title=' + category_name;

var xhr = new XMLHttpRequest();
xhr.open('POST', url);
xhr.onload = function() {
  if (xhr.status === 200) {
    var response = JSON.parse(xhr.responseText);
    console.log('Category Created:', response.response);
  } else {
    console.log('Error:', xhr.statusText);
  }
};
xhr.send();

Conclusion

In this article, we have covered the authentication process and provided examples of using Disqus API using JavaScript. By using the Disqus API, you can programmatically access the Disqus comments platform and perform various tasks such as creating forums, updating forums, and creating categories.

Visit to Disqus website

Similar APIs of Social

TravelBriefing API

TravelBriefing API

Social

Travelbriefing.org, is a free database service for travellers around the world. Access to country-specific information about travel regulations, prevailing environmental conditions, health & vaccines, weather, visa requirements, currency, electric sockets, and language. Everyone can access the set of information that is considered a prerequisite to having a hassle-free journey. The information that Travelbriefing.org provides includes: health & vaccines, weather, visa requirements, currency, electric sockets and language. This API enables developers and researchers to integrate (parts of) database in their own projects.

vaccineweathervisa

Instagram Feed API

Instagram Feed API

Social

A simple & easy way to access your instagram feed with REST API without code. If you are looking to add your Instagram feed into your website then this is so easy. If you don't want to do backend to access your Instagram data.

facebookinstagramsocial

Open Collective

Open Collective

Social

Platform where communities can collect and disburse money transparently to sustain themselves and develop their activities. Community is about trust and sharing. Open Collective lets you manage your finances so everyone can see where money comes from and where it goes.

socialtransparentmoney

Trash Nothing

Trash Nothing

Social

A freecycling community with thousands of free items posted every day. Provides a REST API which allows developers to build apps on top of the trash nothing platform (with thousands of new posts every day and millions of users from around the world).

trashnothingdeveloper

MySocialApp

MySocialApp

Social

Seamless Social Networking features, API, SDK to any app. Increase your user engagement by 100% with your own social news feed Foster engagement and boost loyalty by adding turnkey social news feed into your app.

boostengagementorganic

Twitter

Twitter

Social

Make Twitter APIs endpoint as search, user tweets etc. in few clicks. There are lot's of use cases of Twitter API. Add your home_timeline tweets into your website and Use twitter API to explore content related with your requirements.

twitterapinocode

SharedCount

SharedCount

Social

Social media like and share data for any URL. Created in 2010, SharedCount was the first API tool capable of giving you holistic engagement data on your website content. From simple use with WordPress, to larger API integrations, SharedCount makes it easy to see what content is connecting, what content is not, and where you should focus your efforts to maximize ROI.

socialserpbooklikes

Buffer

Buffer

Social

Access to pending and sent updates in Buffer. Tell your brand’s story and grow your audience with a publishing, analytics, and engagement platform you can trust. Simpler social media tools for authentic engagement. Mix & match our tools, and build a plan that fits your workflow. Buffer has made sharing our story and building our brand on social media so much easier.

Buffersocialstory

Twitch

Twitch

Social

Game Streaming API. Interactive experiences that work as a stream overlay or as a panel. As simple as writing a web app. Create interactive experiences within Twitch chat, which can be used to take requests, moderate content and more. Use Twitch data and Identity tools to enhance your game or connect with your app.

socialextensionchatbots

Cisco Spark

Cisco Spark

Social

Team Collaboration Software. Build the Future of Business Collaboration. One powerful platform. One revolutionary team experience. So many opportunities for developers like you to get involved. How will you leave your mark on Webex?

botsintegrationswidgets