Skip to content

Files

Latest commit

896a38a · Aug 5, 2019

History

History
135 lines (107 loc) · 4.08 KB

api_follow_api.md

File metadata and controls

135 lines (107 loc) · 4.08 KB

Social Follow API

Use the Follow API to link your audience to your various social media profiles to grow your social influence on Facebook, Twitter, Pinterest, YouTube, Instagram, etc. If you're unable to use the Shareaholic JavaScript SDK, you can link to these API endpoints directly.

https://www.shareaholic.com/v2/follow/

?service_nickname=  (required; example: twitter)
&api_key=           (required; example: 8943b7fd64cd8b1770ff5affa9a9437b)
&username=          (optional; example: beyonce)
&app_id=            (optional; example: 1234)
&app_id_name=       (optional; example: contact_page_placement)

One of either username, app_id or app_id_name is required

For example:

https://www.shareaholic.com/v2/follow/?service_nickname=twitter&username=beyonce&api_key=8943b7fd64cd8b1770ff5affa9a9437b

🐦Follow me on Twitter

Authentication

All API endpoints require authentication credentials to be supplied as query arguments (api_key=...). To get started, you'll need a free Shareaholic user account and Site Profile ID. Signup for an account and then add a site to get your Site Profile ID. The Site Profile ID is your API Key.

Alternatives for username

If you prefer, for any reason, not to use your service username in URL, you can use app_id or app_id_name as query argument.

You can find app_id value by clicking "code" link in Follow Buttons overview on your site's application tab on Shareaholic website. Value is shown as data-app-id attribute in displayed HTML.

app_id_name value is name of your Follow Buttons app in Shareaholic interface, with spaces replaced by underscore, for instance: follow_buttons_after_post. Keep in mind that if you change your Follow Buttons application name, this will change too!

Required query arguments

Required query argument are api_key, service_nickname and one of the following: username, app_id or app_id_name.

JavaScript/AJAX requests

It's possible to make follow request that will return JSON, just add .js extension to URL path. For example:

 https://www.shareaholic.com/v2/follow.js?service_nickname=twitter&username=beyonce&api_key=8943b7fd64cd8b1770ff5affa9a9437b

Response:

{
  "status_code": "200",
  "data": {
    "message": "follow created",
    "link": "https://twitter.com/intent/follow?screen_name=beyonce"
  }
}

Errors and error code

On request with missing or invalid query arguments error is returned:

https://www.shareaholic.com/v2/follow?service_nickname=twitter
{
  "errors": [
    {
      "code": "100",
      "source": {
        "pointer": "/data/attributes/api-key"
      },
      "detail": "Invalid API Key. Register an API key for free or lookup your existing API key at https://www.shareaholic.com/sites."
    },
    {
      "code": "120",
      "source": {
        "pointer": "/data/attributes/username"
      },
      "detail": "Invalid username, app_id or app_id_name. Check out the docs at https://github.com/shareaholic/shareaholic-api-docs/blob/master/api_follow_api.md for usage examples."
    }
  ]
}
List of error codes
  • 100 - api_key was not provided
  • 101 - api_key provided is invalid
  • 110 - service_nickname is not provided
  • 111 - service_nickname provided is invalid
  • 120 - username or app_id or app_id_name is missing in request or invalid value provided

Supported Service Nicknames

  • about_me
  • bbb
  • behance
  • bloglovin
  • disqus
  • dribbble
  • ebay
  • etsy
  • facebook
  • feedly
  • five_hundred_px
  • flickr
  • foursquare
  • github
  • google_classroom
  • google_plus
  • houzz
  • instagram
  • itunes_podcast
  • linkedin
  • linkedin_company
  • livejournal
  • mix
  • odnoklassniki
  • pinterest
  • polyvore
  • rss
  • skype
  • slideshare
  • soundcloud
  • spotify
  • stackoverflow
  • tripadvisor
  • tumblr
  • twitch
  • twitter
  • vimeo
  • vine
  • vk
  • wechat
  • yelp
  • youtube
  • zillow_digs