Getting started with the Mastodon APIs – notifications

The docs for the Mastodon APIs are pretty good, but there’s a surprising lack of working examples online (compared to using the Twitter APIs) which means starting out I’ve been stumped several times already trying to work out how to what seem to be simple things.

Publishing a new status (a ‘Toot’, equivalent in Twitter terms to a ‘Tweet’), is easy enough with POST /statuses . Getting a list of who has mentioned you in a status was not that obvious though.

I took a look at getting my timeline with various options, using GET /timelines, before realizing what I was probably looking for was GET /notifications which can be filtered by various types, including mentions, using

GET /notifications?types[]=mention

Note the types array parameter with [] following the name. I haven’t seen this convention used before, but this is described in the docs here.

Most of the APIs returning statuses look like this:

{
      id: 'unique-id',
      type: 'mention',
      created_at: '2022-11-20T04:46:33.902Z',
      account: {
        // details about the account that posted this status
      },
      status: {
        id: 'unique-id-for-this-status',
        created_at: '2022-11-20T04:46:22.000Z',
        in_reply_to_id: null,
        in_reply_to_account_id: null,
        content: {
          //content of the status here, as HTML
        }

Note that the type=mention here, as this is what we filtered for with the types=[] parameter.

The ‘Social Enterprise’ according to salesforce.com

I had the chance to go to the saleforce.com CloudForce/CloudStock event in SF yesterday. I went primarily to attend the tech sessions on using Heroku and Amazon AWS, but it was interesting to sit in the keynote session and hear the salesforce CEO Marc Benioff give his sales speech on why Social Media is big for business. In a nutshell, here’s my summary of what social means to business (from the view of salesforce.com):

  • Social Media has exploded in popularity. It’s massive.
  • Integrating the way you do business with Social Media allows you to connect with your customers/clients and their needs, wants, likes, dislikes – accessing a goldmine of marketing information and the potential to building ongoing/interactive relationships with your customers
  • Integrating social media concepts within the enterprise brings benefits of growing communities within the company, increasing inter-team/group/department interactivity, increasing group collaboration and access to current/relative information and events in real time

As a consumer, I’ve often had the opinion that I don’t want company x knowing what I ‘like’ on Facebook, or what videos I’m watching on YouTube. Hearing Benioff and other salesforce.com customers talk about the profound beneficial changes that Social Media is bringing to their companies, it was interesting to hear why this is an important trend for doing business in today’s world. Information is key to succeeding in business, and it’s obvious why businesses ‘want in’ on the social media scene to use this data for their own advantage. Whether all consumers want businesses they interact with to have access to their personal likes, dislikes and online activity though is another story.