Cosmic JS Blog Stay tuned for feature roll-outs, community news, and updates from the Cosmic JS team.

Adding Webhooks in 4 Steps


At Cosmic JS, we get questions every day about adding Webhooks to an application for better team & product management. Cosmic JS is an API-first cloud-based content management platform that allows you to easily integrate a CMS to your deployed or emerging application for content updates. Cosmic JS works by decoupling content from code, allowing you to build applications in your desired language since Cosmic JS can be integrated with any application, regardless of its programming language.

Cosmic JS makes it easy to add Webhooks that trigger a POST request to the endpoint of your choice when there is activity on your bucket. 


Let's insert Webhooks into your web application:


1. Go to your Bucket Dashboard



2. Go to the Webhooks tab



3. Add the Webhooks bucket upgrade - refer to Cosmic JS Pricing for bucket breakdowns




4. Use the Webhooks table to select an event and trigger a POST request to the API endpoint



Now this will post to the endpoint of your choice whenever the event signified occurs. This is great for static websites & great for the build process whenever content is changed. You can send a message on Slack to your team whenever you’ve added a new piece of content for draft review. Cosmic JS builds collaboration between developers & content editors in everything we do, because we work content-first.


Watch the Webhooks Tutorial: 

 


Read More:

  1. New: Track Your API Requests
  2. Build a Blog in 4 Steps
  3. The Cosmic Stack
  4. Three Ways to use The Cosmic Stack
  5. How to Create an Intuitive Website Navigation Menu


You may also like


Building websites and applications with the Cosmic JS API is simple and intuitive for teams through role permissions.

In this installment of the Cosmic JS Developer Spotlight Series, we sat down with Raymond Camden, a Senior Software Engineer and Developer Advocate residing in Lafayette, Louisiana. Raymond has extensive experience in the technology space, having enjoyed stints at IBM, Adobe and AuthO prior to becoming a Senior Engineer for Developer Experience at American Express. Follow Raymond on Twitter, GitHub or LinkedIn, and enjoy the Q/A.

Today we're announcing our referral program which rewards you for spreading the word about Cosmic JS.  It's our way of showing our appreciation for you when you tell friends and colleagues about us.

Cosmic JS is great for hosting content for an entire website or application, but can also be used to add quick, dynamic content elements to any existing website.  In this short tutorial, I'll show you how you can add a news feed widget to your website in a few short steps.  Let's get to it:

1. Sign in to your Cosmic JS account.

2. After signing in, select "Add object type" in the left side nav of your bucket's dashboard and create a "News" object type.  Call the object type "News" (plural) and "Article" (singular).  Then add your articles (you can add content or metafields later, they're not required for this example).


3. In your HTML file add a div that will receive the news feed then add the Cosmic JS browser client to get your bucket's content.  You can download the Cosmic JS Browser Client on GitHub.  Next, in only a few lines of code, you can get the articles from your bucket.  Here is a quick JS Fiddle of everything you will need:

You can see how powerful this is.  A developer can add these dynamic areas to any portion of an existing site and enjoy the benefits of a CMS API.  Any non-dev team member can be invited to edit this content in the Cosmic JS admin dashboard quickly and easily with no database or server-side installation necessary!


In this short tutorial I’m going to show you how to:

1. Upload an image to your Cosmic JS Bucket via the Cosmic JS API.
2. Alter your image using the powerful Imgix processing service (free with every Cosmic JS Bucket)
3. Add the uploaded image as a Metafield to an Object in your Bucket

In this tutorial I'm going to show you how to create a "Ecommerce" app using a little bit of Node, and Cosmic JS. For the sake of understanding how to consume Restful API’s, this tutorial will show how to make simple AJAX requests to the Cosmic JS API in order to retrieve, update, and delete data in our Cosmic JS buckets. Let's get started.