Why Use a Social Media API?
If you want to manually post and schedule social media to networks like Twitter, Instagram, Facebook, LinkedIn, or YouTube, there are some excellent web-based posting tools out there. However, if you run an app or platform, say for example a CMS that allows users to create content, your users typically want a simple process to post to social media networks without having to download the content and do it manually. This sharing can be part of a workflow or an automatic process, but the point is you want to make sharing simple and easy for your users without them leaving your platform.
A unified API for social media makes it possible to programmatically publish from your backend system, allowing you to control the content, posting schedule, management, and reposting on behalf of your users.
Ayrshare Social API
Ayrshare is a powerful set of APIs that enable you to send social media posts, get analytics, and add comments to Twitter, Instagram, Facebook, LinkedIn, YouTube, Google My Business, Pinterest, TikTok, Reddit, and Telegram on behalf of your users.
Using the Ayrshare module
This first version of the Ayrshare module was built to be the easiest solution in the market. Simply install the module, set the fields mapping, link your social accounts, activate it, and you are done. The Ayrshare module page has full instructions on how the module can be configured.
Features
The module supports the following features
- Publish posts for current user active social platforms.
- Get and create comments
- Get social history (API history)
- Get Social analytics information (different metrics per social platform)
- Delete posts
- Views integration (for posts, analytics and comments tables)
How we use it at Morpht
We have to admit it... we are not the best at promoting our own work at Morpht. Oftentimes the publishing of content to our social media properties is an afterthought. Ayrshare is a natural fit for us because it makes it possible to update the socials just after we publish the content. We use the Ayrshare module to post our blog posts on Twitter and Linkedin. Take a look. How did we do?
Our setup
We use the article content type as source of social media posts and in particular the field_social_post field, here you can see the mapping configuration:
The field_social_post field is a Field Token Value which allows us to add multiple values from other fields into it.
For example we are getting the value of the field field_social_message + the article absolute URL:
Sharing the posts
Recently we created a new post announcing the Field Formatter Pattern module and as you can see below we use the field_social_message field to define the text that we want to share in our social networks accounts.
Then under the Social Tools tab we chose the Push To Social option, check the target social networks and click on Post.
And Voila! 🎉
After clicking on Post we can see the post successfully posted in the social network account:
Conclusion
By using Ayrshare social API our team can focus on building amazing Drupal sites instead of stitching together and maintaining multiple social media platforms.
We hope you find this module of use in one of your projects too.