![]() MyHeaders.append("Authorization", "Bearer API_KEY") Here is the /post call with code generated by Postman in JavaScript-Fetch: javascript Simply click the icon in the context bar in Postman, choose your programming language, and your code will be generated. One amazing feature of Postman is the ability to generate code in over a dozen programming languages. Typically, the next step would be to make these REST endpoint calls in your code, with languages such as Python, PHP, or JavaScript. ![]() The response bodyĬongratulations, your post is now live on all four social networks! Bonus: Generate code in Postman You also get four URLs for the posts, so you can click through to each of the URLs (remember to CMD-click). The result returns an array of postIDs, one for each of the social networks. "post": "The beauty parlor is filled with sailors The circus is in town",Ĭopy and paste the above JSON into Postman and click Send. In this sample post, we added post text, selected four social networks to publish to, and added an image from Unsplash (credit: photo of sailor.js by Kir Simakov on Unsplash). You can see an example such as the one below in the collection nested under the /post call. Postman Collections allow API producers to add examples to help users get started. Select the POST /post endpoint in the left-hand panel, and then click on the Body tab and the raw radio button. If you choose to link other social networks, you can replace the value with the appropriate name, such as “pinterest.” In the following example, we’ll publish a post to Twitter, Instagram, LinkedIn, and Facebook. Next, we’ll publish a post to the social networks you previously linked in the Ayrshare dashboard. You can set your own API_KEY value in the Globals section of the Environments tab in Postman. The Ayrshare collection already has the environment variable set for each endpoint. The main advantage of environment variables is decoupling the secret keys from your code and having them located in a single, updatable place. ![]() Postman allows you to set environment variables that can be used by all of the endpoints within a collection. Set the API key as an environment variable In this section, we will use Postman to make a REST API call to the endpoint, which will publish our social media post. Now that our social accounts are connected, we can start posting. This linking process uses secure OAuth to keep your accounts safe. Next, navigate to the Social Accounts page in the Ayrshare dashboard and link each of your social accounts, such as Facebook, Twitter, and LinkedIn.You will find your API key in the web dashboard. First, go to to sign up for an account.The Ayrshare collection in the Postman Public API Network Connect your social accountsīefore we can use the API endpoint to send posts, we need to create an Ayrshare account and link our social accounts. You will see many endpoints available, but we’ll focus on the /post endpoint for this article. Then, fork this collection so that you have a local copy that you can edit. Search the Postman Public API Network for the Ayrshare collection. We’ll also explain how Ayrshare leverages the Postman Collection to make it easy for our clients to get up and running quickly. This includes Facebook, Instagram, LinkedIn, Google Business Profile, Pinterest, Reddit, Telegram, TikTok, Twitter, and YouTube. ![]() Ayrshare is the leading social media API that allows platforms and businesses to easily post to all ten major social networks from their platforms. In this article, we’ll show you how to post to all of your social accounts with the Ayrshare Postman Collection. There are multiple social networks that have crossed over a billion monthly active users-including Facebook, Instagram, YouTube, and TikTok-and their continued growth makes them a great channel for businesses building a brand and finding new customers. This is a guest post written by Boris Markovich, co-founder at Ayrshare.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |