Xilution Blog

Beagily in 15 Minutes

By Todd Brunia
Beagily is a simple JSON data storage API. It's great for prototyping and rapid concept validation. I created this mini tutorial to help coders quickly learn the Beagily basics.

Prerequisites

  1. Create a Xilution account in our Test environment.
    1. Restricted access to Beagily is provided for FREE in our Test environment. See the Beagily product details page for pricing and restriction information.
  2. Activate Beagily through our Customer Admin Portal in our Test environment.
    1. To activate Beagily (or any other Xilution product for that matter), log into the Customer Admin Portal in Test and navigate to the Products page.
    2. Beagily may have been automatically activated when you created your account.
  3. Look up or create a Xilution Client.
    1. You'll need a client ID to request a Xilution Access Token.
    2. To see the clients associate with your Xilution account, log into the Customer Admin Portal in Test and navigate to the Clients page.
  4. You'll need a way to interact with the API. We recommend Postman, but you could use any similar app. You could also simply use cURL as well.
    1. I assume that you know how to interact with an API through utilities like Postman and cURL, so I'll keep the following instructions as brief as possible.
Note: At the time of this writing our Test and Prod accounts are not synchronized. So, if you choose to use Beagily in our Prod environment, you'll need to repeat these step in our Prod environment.

Authentication

Beagily (along with all other Xilution APIs) uses the OAuth 2 authentication. To acquire a Xilution Access Token...

POST: https://test.authentication.core.api.xilution.com/oauth/token

grant_type=password&username={your-username}&password={your-password}&client_id={your-client-id}&scope=read%20
write

Response: The response will include a property named access_token. This is your Xilution Access Token. It is a bearer token. You will included this as a request header called Authentication with each subsequent request mentioned in this mini-tutorial. The value of the header will take the form of: Bearer {your-xilution-access-token}.
Note: The format of the this Post body is x-www-form-urlencoded and should be URL encoded.

Create a Type

Beagily uses schema defined by you to validate things that you POST and PUT to the API. You register your schema with Beagily like this.

PUT: https://test.beagily.basics.api.xilution.com/types/pet

{
  "$schema": "http://json-schema.org/schema#",
  "title": "Pet Schema",
  "type": "object",
  "properties": {
    "@type": {
      "enum": [
        "pet"
      ],
      "type": "string"
    },
    "owningUserId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    }
  },
  "required": [
    "@type",
    "owningUserId",
    "name"
  ]
}

Remember: You need to include the Authorization header with this request and all the following requests.
Note: @type and owningUserId are required thing properties in Beagily. The type name and the enum are both singular.

If you want to see your pet type you can...

GET: https://test.beagily.basics.api.xilution.com/types/pet

Post a Pet

POST: https://test.beagily.basics.api.xilution.com/things?type=pet

{
  "@type": "pet",
  "name": "Muffy",
  "owningUserId": "{your-user-id}"
}

Response: The response headers include a Location property that includes the identifier of the new pet.
Note: As before, the type name is singular.

Update the Pet

PUT: https://test.beagily.basics.api.xilution.com/things?type=pet

{
  "@type": "pet",
  "id": "{the-pet-id-found-in-the-previous-post-response-location-header}",
  "name": "Muffy",
  "owningUserId": "{your-user-id}"
}

Note: As before, the type name is singular.

Get the Pet

GET: https://test.beagily.basics.api.xilution.com/things/{the-pet-id-found-in-the-previous-post-response-location-header}?type=pet

Note: As before, the type name is singular.

Search for the Pet

Beagily uses a two part search process. First you create a search criteria record...

POST: https://test.beagily.basics.api.xilution.com/search-criterias

{
  "@type": "fetch-pets-search-criteria",
  "owningUserId": "{your-user-id}"
}

Note: This time the type name is plural.

Now, submit this GET request to search...

GET: https://test.beagily.basics.api.xilution.com/things?page-size=10&page-number=0&search-criteria-id={the-search-criteria-id-found-in-the-previous-post-response-location-header}&type=pet

Response: The response will be the pet that you posted earlier including the ID and some other meta-data.
Note: Pet is singular again and the page index is zero based.

If you want to narrow the search, add a criteria property to the search criteria...

POST: https://test.beagily.basics.api.xilution.com/search-criterias

{
  "@type": "fetch-pets-search-criteria",
  "criteria": {
    "name": "Muffy"
  },
  "owningUserId": "{your-user-id}"
}

The search criteria is pretty primitive at the moment. There's a lot we could do with the criteria object to make the searches more dynamic including wild cards, ranges calculations, etc. Let me know your use case and we'll try to accommodate your needs.

Other Resources

Wrap Up

Hope this mini-tutorial inspires you to give Beagily a try and helps you quickly get up to speed with the Beagily basics. I tried to keep these instructions brief and may have overlooked an important detail.  If you find the instructions need more context send me an email at tbrunia@xilution.com and I'll make the needed changes. Happy coding!


Xilution uses Gatsby for Static Site Generation

By Todd Brunia
The Xilution web site has gone through a significant amount of change over the last couple of years. Here's a brief story of the latest rendition in which I used Gatsby.js to solve some nagging single page application performance issues.

About two years ago I created the Xilution web site (actually several micro UIs partitioned by subdomains) using Vue.js. I was drawn to Vue.js because it promised to help me publish lots of needed web content for my growing startup quickly. Turns out, Vue.js was just what I needed and I was able to create more web content in less time than I had ever done in the past.



About a year ago, I set out to create the Xilution Customer Admin Portal. At the time, my experience with Vue.js was limited to the few micro UIs that I created for Xilution, but I had lots of experience working with React.js through my day job. Since I was more confident creating larger sites with React.js, I went that route for the portal. One thing led to another and I ended up porting all the Xilution web site micro UIs to React.js and Redux. No slight to Vue.js. I'm just more comfortable with React.js (especially for unit testing).

Moving forward in time to about a month ago, I started paying more attention to Xilution's web performance and SEO. I quickly learned that Xilution's single page React.js apps were suffering from bundle bloat. I spent hours with Webpack Bundle Analyzer attempting to reduce the size of the bundles. I got frustrated pretty quickly. I needed a different way of thinking about my site construction.

I reached out to the local Javascript development community here in Des Moines for help. A good friend suggested that I take a look at Gatsby.js. I was familiar with Jekyl and the benefits of static site generation, but didn't want to go down the Ruby route. I had also tried Hexo on a very early version of the Xilution blog, so the concepts of static site generation were comfortable to me. I also liked the idea of reusing a good portion of my existing React.js components from the single page applications.

About a week ago, I starting porting the Xilution landing page to Gatsby.js. It took about a day to complete the process. Moving my existing React.js components into the Gatsby.js framework was surprisingly easy. Next, I moved on to the Xilution products site which was a little more difficult because it pulled in product data from a Xilution API. The Using Gatsby without GraphQL documentation proved to be especially useful for this site port which was completed in about a day as well. Four more micro UIs followed and the migration was complete. The process went very smooth and I couldn't be happier with the lighting quick performance of the site. Check it out for yourself!

ICYWW, I did not port the Xilution Customer Admin Portal or the Xilution registration site to Gatsby.js because they need to support dynamic user interaction and wouldn't have been a good fit.

If you're supporting mostly static single page applications and like me struggled with performance, you may want to give Gatsby a try. It's especially good if you are already familiar with React.js. Happy coding!

RSS Feed Now Available

By Todd Brunia
I'm happy to announce that we have set up an RSS feed for the Xilution Blog.



You can access our blog feed through the following links.


Hit us up on Twitter with your thoughts. If you experience an issue with our feed, please email support@xilution.com. Happy reading!

Beagily in Action

By Todd Brunia
I created https://github.com/xilution/xilution-react-todomvc to demonstrate how Beagily could be integrated into a real world project. This project features a React single page web application frontend integrated with a serverless Node.js backend. Best of all, the project's code has 100% unit test coverage!

The project source code includes comprehensive instructions and it only takes about thirty minutes to set up.


The frontend is hosted on AWS S3 and could easily be extended to be hosted with a custom domain name through AWS CloudFront. The Frontend is built with Webpack and uses Jest and Enzyme for unit testing.

The backend features an AWS SAM configuration which provisions an instance of API Gateway backed by several Lambda functions. The backend uses Joi for input validation, is build with Webpack and uses Jest for unit testing.

I'm hopeful that this example inspires you to use Beagily in your next project.

Spenser Andreassen Joins Xilution

By Todd Brunia
I'm pleased to announce that Spenser Andreassen has joined the Xilution team as a cofounder. Spenser brings a wealth of technical knowledge and ambition to Xilution's growing team. I'm excited for the synergy that Spenser and I have built over the years and am eager to partner with him to take Xilution to the next level.


Spenser has hit the ground running as the product owner of a new Xilution product. Construct of the highly anticipated product is well underway. Stay tuned for a product launch announcement soon! 🚀

Spenser is a lifelong learner with a passion for building quality software products. Spenser has been working in the Des Moines area IT industry for the past 5 years honing his skills in multiple industries and technologies. He has a bachelors degree in Management Information Systems from Iowa State University. Spenser enjoys most outdoor activities especially running, biking and disc golf.

Welcome to the team, Spenser!

Introducing Chickadee

By Todd Brunia
Here at Xilution, we subscribe to the notion that necessity is the mother of invention. We needed a way to automated our Twitter posts. We looked around and found several social media management platforms that could have met our needs; however, we passed. They were expensive, limited and quite frankly overwhelming.

So, as an API company, we set out to create our own right sized Tweet scheduling solution. About two weeks ago, we started working on a product we call Chickadee.



Chickadee is a no-frills Tweet scheduling API. The benefits to our API customers that activate Chickadee are...
  • Only pay for what you use pricing (regardless of scale).
  • Unlimited Twitter accounts.
  • Unlimited Twitter Posts. (Only restricted by the Twitter API throttles.)
  • Webhook for Tweet event notifications.
  • Auditable Tweet history.
  • REST API is interoperable with almost any programming language.
It's a testament to the Xilution platform that the product came together so quickly. We were using the API within a week and a half of concept inception. We've tested it ourselves and now we're ready to share it with the others.

We're seeking beta testers

We're actively seeking organizations to help us beta test Chickadee. If your organization manages one Twitter account or hundreds, we would like to visit with you and see if Chickadee is a good fit. We think the ideal fit for Chickadee is a tech savvy organization that has experience with the popular social media platforms and is dissatisfied with the costs and limitations. If you check these boxes, send an email to tbrunia@xilution.com to schedule a demo. An onsite demo is available if you are in the Des Moines area.

Thank you for your help. We really appreciate referrals too!


Xilution's First Blog Post

By Todd Brunia
About a month ago, we started using Twitter to share Xilution announcements. Twitter has been a good tool for communicating short bursts of information. There's lots of upside to Twitter, but it does have limitations. First, 280 characters just isn't enough capacity to share the great things we're doing here at Xilution. Second, the half life of a Tweet is about an hour.


Blogging will allow us the freedom to tell our story more comprehensively than we could in a Tweet. We plan to use our blog for communicating team and product announcements. We also plan to use our blog for sharing information about the API economy. We want to be a thought leader in this space and will use our channels to promote API advancement.

We think a blog has a much longer half life than a Tweet. We are hopeful that our posts will be referenced days, weeks and months after they have been posted. We will strive to bring you timely and relevant information which will give the content life beyond a couple of hours.

We're excite to start our blogging journey. Stay tuned for more content and announcements!