XapiX Blog

Prototyping APIs in 5min

Posted by Elizabeth Ferrao on May 1, 2017 8:51:06 AM

You have a lot of data but don't know how to make an application that allows you to pull certain values from the data whenever you want. Well you're in the right place because XapiX has that functionality. 

You'll need: 

1. Data in a CSV file 

XapiX provides: 

1. An easy uploader and editor to turn your data into an API!

 

Here is a screenshare of how I executed the tutorial: 

 

 

 

Let's start! 

Make a project 

Go to https://wizards.xapix.io/. Click "CSV Import" so we can import our data. 

 

But before we upload our CSV, let's make it perfect:

1. Delete spaces / symbols / punctuation in file name

2. Delete empty rows in header column 

3. Delete empty or unused columns between your first and last columns with data 

4. Delete any additional data-containing cells

 

Now let's drag or upload our CSV file. This is my CSV file - I exported it from Google Sheets to a .csv. 

Screen Shot 2017-05-01 at 8.33.14 AM.png 

Click "Start Project". 

 

You've made your own API!

Let's play around and see the components.

Screen Shot 2017-05-01 at 8.34.20 AM.png

 

 

When I click "index" ('show all' in RESTful lingo), I see a sample API call based on the key/value pairs in your CSV. Screen Shot 2017-05-01 at 8.35.07 AM.png

 

Rename project

XapiX automatically generates a project name, but let's make it memorable.

On the left pop up, you can see other projects, but at the top right next to "Delete", there's "Edit". Screen Shot 2017-05-01 at 8.36.01 AM.png

Click "Edit". Enter the preferred project name. Plan and Authorization level will stay the same for now. Screen Shot 2017-05-01 at 8.36.47 AM.png

 

Click "Dashboard".Screen Shot 2017-05-01 at 8.38.03 AM.png

You've updated your project name. Screen Shot 2017-05-01 at 8.39.02 AM.png

 

 

Swagger UI

Let's see our API operations. Click on 'Swagger UI' next to 'Web CLI UI'. 

Screen Shot 2017-04-30 at 12.21.10 PM.png

In "Test Interface", click "List Operations". Now we can see the call type next to what it's calling. Screen Shot 2017-05-01 at 8.39.45 AM.png

 

Click "Expand Operations". Now click the small gray "Try it out!" button under Response Messages. Something like this will appear. Screen Shot 2017-05-01 at 8.40.46 AM.png

Now you understand the request types behind your API!

 

Calling our API

Let's call our API with our Root URL and Authentication (token_auth). In 'dashboard', click "Toggle". Your token will appear. Screen Shot 2017-05-01 at 8.41.37 AM.png

Now you can call your API!

 

Changing names

Let's change the name of our classes. Below is a video of how to do it: changing_csv_data.

 

 

Changing CSV data names

Navigate to Resource Classes: 

Screen Shot 2017-05-01 at 8.42.22 AM.png

 

Click the 'Resource Collection Name' - mine is Bosch_rain_sensor_api. 

Screen Shot 2017-05-01 at 8.43.26 AM.png

 

Click on the name to edit. Enter the new name and click 'Save' at the top right. 

Screen Shot 2017-04-30 at 1.00.29 PM.png

 

A top blue bar will pop up saying "Resources Class was successfully updated". 

Screen Shot 2017-05-01 at 8.44.22 AM.png

 

Click 'Publish'. Then click 'Migrate' to update the API. 

Another blue bar will pop up: "Endpoint migrated". Screen Shot 2017-05-01 at 8.45.19 AM.png

 

Head back to the project dashboard to test the API. 

We can see the name has been updated in our requisite field. 

Screen Shot 2017-04-30 at 1.15.02 PM.png

Click 'index' to see an API call. 

Our API has been updated. 

Screen Shot 2017-05-01 at 8.46.01 AM.png

You can now update key names!

 

So we leave it to you. 

What APIs will you make with XapiX? Let us know in a comment below.

Have fun building :)

logo-2.png

Welcome to the XapiX Blog

Your Portal to the API World

Check back here often or subscribe below to get the lastest on the API world from XapiX. From developer community interviews to insights and stories from the XapiX team itself, our blog will keep you updated with the most recent API trends.

Subscribe to Email Updates

Posts by Topic