Forum Academy Marketplace Showcase Pricing Features

How to setup up Ayrshare API to post on social media on behalf of your users

Hey, all you wonderful no-coders out there.

Last month I set up the API connection to Ayrshare allowing us to post (and schedule) on social media on behalf of our users.

We now have 346 users connected and are thrilled with it so far. @gbourne and his team have been very helpful on supporting me through the process, and I want to share my set-up, so you can give it a go too.

Ayrshare account and API key

Before starting, you have to create an account with Ayrshare to get your API key. If you want to post on behalf of your users, you’ll need a Business plan: Business Plan For Multiple Users - Ayrshare

API connector
They do have a plugin if you just want to use it for yourself, but if you want to post on behalf of your users, you’re going to have to set up via the API connector. No worries if you haven’t done this before, it’s actually straightforward once you start.

how to set it up

  • open the Plugins tab
  • click on API Connector
  • Add another API > give it a name (I called mine Ayrshare)
  • Set Authentication to “None or self-handled”
  • In the shared headers for all calls, add two shared headers
    Key: Authorization Value: Bearer (your API key)
    (don’t forget to add Bearer in front if you want this to work.)
    Key: Content-Type Value application/json

Adding the calls

Depending on how you’re going to use the API, you’ll want to create several calls.
You’ll find the list of available calls in their documentation here: Endpoints - Ayrshare Docs

how to create a new call

  1. click on “Add another call”
  2. give it a name (mine all start with Ayrshare + call type)
  3. select Use as “Action” if you want to able to use it in the workflow, or “Data” to just get the data
  4. data type for this set up is always JSON
  5. POST or GET depending on the type of call you’re setting up and URL for the call (you’ll find this in the documentation)
    Note, when you copy the URL from the documentation, there is often a space in the URL. Remove it of the call won’t work.
  6. Headers you can leave blank as we’ve added them at the top
  7. Body Type - for this setup is JSON
  8. Parameters & Body > see setups below
    note: you’ll want to activate “include errors” and “capture response headers” to get messages back in case something goes wrong.
  9. When you’ve finished setting up the call elements, click on Initialize Call to test the setup and start using the API call.
    If there is a problem with the set-up, you’ll get a message from the server.

Here are the main calls I set up for reference and the ones with some “unique needs”.
Once you’ve done a few, the others mainly follow the same rules :slight_smile:

Create user profile (documentation)

Generate a JWT (documentation)
You will get the domain name and the key from Ayrshare upon signup. I recommend to keep these private.
The profile key is unique to each user - uncheck private so you can add this dynamically on each call. You can get that from the Ayrshare account when setting up under user profile > profile key.

Post (documentation)

Analytics (documentation)
In the platforms field, enter the names like this: “facebook”, “instagram”, “twitter” (currently no stats on linkedin, so if you add that platform there will be an error).

GET Comments (documentation)
This setup is a little different as the parameters are added to the URL instead of the body.

Those are the main ones I needed help with. The others so far were quite straightforward.

Once you’ve set this up, here is an article to help with the next steps: How To Create A Social Media Scheduling App With No Code - Ayrshare

I hope this was helpful and will continue updating as I continue my Ayrshare journey :slight_smile:
Happy posting !

7 Likes

Thanks for this, Dee! I’ve been looking at this for my own SM campaigns but wondered how to configure each post for the different platforms.

5 Likes

Thanks @dee we were able to setup all the calls except generate JWT,
Everything works fine in POSTMAN though.

1 Like

I had a few issues setting that one up because of the Key. Probably best is to reach out to @gbourne who can help you with that.

Hi @technoswift - here are the Bubble-specific instructions on how to generate the JWT Token.
https://docs.ayrshare.com/packages/bubble.io#generate-jwt-token-in-bubble

4 Likes

Thank you @ayrshare team, this works perfectly.

3 Likes