How to Convert Phone Numbers Into Real Business Data with EveryoneAPI

EveryoneAPI by Telo allows to convert a phone number into real business intelligence with a simple API request. The complete reverse phone append product is simple to use, yet powerful and built for developers by developers. As you probably already know, integrating with any 3rd party REST API using the Appery.io Server Code is also simple. In this blog post, I will show you how to invoke a test a script that calls the Everyone API.

To start, create a new Server Code script with the following code:

var telephone = request.get("telephone");
var url = "https://api.everyoneapi.com/v1/phone/"+telephone;
var auth_token  = "AU83e975.....";
var account_sid = "AC659275.....";

var XHRResponse = XHR2.send("GET", url, {
   "parameters": {
      "auth_token": auth_token,
      "account_sid": account_sid,
      "pretty": "true"
   }
});
Apperyio.response.success(XHRResponse.body, "application/json");

The only thing you need to do, is to replace the auth_token and account_sid with values from your account. Sign up for an account here. It’s fast and simple.

The phone number for which you want to get information is passed as a parameter to the script (line 1). To test the script, switch to Script parameter tab (on the right side), enter a parameter called telephone and then set it to a test value. Here is an example testing the API using the Appery.io telephone number:

everyoneap_servercode.png
AnyoneAPI Server Code script

Once you finished and tested the script, you easily import into your app. This video shows how to do that.

Looking for more APIs by Telo? Check out the CallerID Server Code plug-in:

callerid_servercode_plugin.png
Caller ID Server Code plug-in

This plug-in creates a Server Code script that integrates with OpenCNAM API. The OpenCNAM API allows you to get caller ID information for phone number provided.

Appery.io Mobile Resources You Should Know in 2017

Happy New Year!

As we are starting 2017, we want to let you know about all the Appery.io resources available to you, to help you build you app faster and easier. These resources are being updated with new content all the time, so we definitely recommend subscribing to updates or following them. This way you will be always up to date with what is happening. Let’s get to the resources.

Developer Documentation and Portal (http://docs.appery.io)

The docs site is the most important resources (obviously). The docs site contains the platform documentation, tutorials, and API reference section. We regularly update the content on this site. If you find a typo or an error, please use the Suggest Edits feature to tell us about it.

The docs site has a blog section (http://docs.appery.io/blog) where we usually post technical information such as API updates or library updates. The information is usually very technical and specific so it doesn’t go on the main blog. We will also post links to tutorials and videos.

The Appery.io blog (http://blog.appery.io)

The blog is one of the most important resources you should read. This is where we post platform updates, announcements, new videos, new tutorials, case studies and anything else. We definitely recommend you follow the blog to stay up to date. Following the blog is very simple. You can subscribe via the RSS feed or subscribe via email (you will get an email every time a new post is published).

YouTube Channel (http://youtube.com/apperyio)

This is our most popular resource. Our YouTube channel has over 200 short videos on various topics to help you build apps faster. Definitely subscribe to get updates when we publish new videos. The videos are organized into playlists:

Most of our videos are no longer than 15 minutes. This allows you to learn about a topic, feature or benefit very fast and you won’t be bored through an hour long example.

Community Forum (http://appery.io/forum)

Our community forum is the place to get help, ask questions and help your fellow Appery.io developers.

Platform Status Page (http://status.appery.io)

Appery.io platform status page shows each platform component and its current status. It’s important to bookmark or follow this page via RSS to always know the status of each component.

Twitter (http://twitter.com/apperyio)

Twitter is where we post important announcements, platform updates, new tutorials, case studies, new videos and anything else. We recommend to follow up on Twitter to always stay up to date.

Facebook Page (http://facebook.com/apperyio)

Facebook is very similar to Twitter. On Facebook we post important announcements, platform updates, new tutorials, case studies, and new videos. We recommend to Like us Facebook to always stay up to date.

LinkedIn Company Page (https://www.linkedin.com/company/appery-io)

On our LinkedIn Company Page we post announcements, new tutorials, case studies, and new videos.

Google+ Page (https://plus.google.com/u/0/104276681162289155352)

Yes, we are still on Google+ :).

Instagram (https://www.instagram.com/apperyio/)

This is a new resource and we will be posting a lot more in 2017.

What’s New Panel

And a bonus resource is our What’s New panel. The What’s New panel can be opened from any platform page from the header. The panel shows you the most recent updates, tutorials, and videos. Check this resource often to learn what’s new.

whatsnew-panel.png
What’s New panel.

 

How to Connect to FullContact API From Appery.io Server Code

FullContact Developer APIs such as Person API, Company API, Email API and others can provide social profiles in an app, improve contacts in address book, enrich CRM information, and create marketing campaigns.

To make it simple to use FullContact API, we created a Server Code plug-in that quickly creates a script to invoke the Person API. You only need to set the FullContact API key. The following animated GIF shows how to insert the FullContact plug-in and its script:

fullcontact_servercode

Once you set the API key, it’s fast to test the script and the API. Switch to Run tab to test the script. The script comes with a sample email. Feel free to change the input data.

FullContact_ServerCode_run-1024x429.png
Script testing

You can also set the email as a script parameter. Update the script code to look like this:

var email = request.get("email");

and then add the parameter on Script parameters tab.

Using the Server Code plug-in for FullContact API it’s fast and simple to invoke the Person API. Using this plug-in as a starting point, you can update the script to include other API parameters or use other APIs.

Using Geolocation in a Mobile App: A Video Guide

Geolocation is one of the most widely used APIs in mobile apps today. From weather to Uber and Lyft, the device location is crucial information and many APIs use it to determine what services and products are available in a given location. When building a mobile app in Appery.io, using the Geolocation API is simple. Apache Cordova library is built-in in every new Appery.io app. Invoking Geolocation will return the latitude, longitude (and other) information which can then be passed to any REST API. The following two short videos show how to use and invoke Geolocation in an Ionic and jQuery Mobile apps:

Looking for more videos like that? Check Appery.io YouTube channel for many more videos.

Appery.io Platform Overview: A Video Guide for Mobile Developers

This video provides a high-level overview of the Appery.io Platform. Using one-slide, the video goes over the major platform features and benefits. Whether you are new or an existing Appery.io user, this is a great video to get an overview how to build apps on the platform.

 

Check out the Appery.io YouTube channel for more videos like this.

Find Out How to Build Cordova Apps Fast

One of the core components in Appery.io platform is a cloud build service which builds a binary file (hybrid) for iOS or Android. Appery.io leverages Apache Cordova (PhoneGap) to create a binary file. Launching the build process is very simple. Right from inside the App builder, clicking the Export button you will see the option to create a binary file for iOS or Android.

 

apperyio_export
Export menu

 

Once Binary (.ipa) or Binary (.apk) is selected, the build process starts. The build process usually takes one minute. When the build is completed, the file is downloaded to your computer. From there you can publish the app to an app store, using the standard publishing process for each store.

Learn more about how to use Apache Cordova in Appery.io to build hybrid apps and use native APIs.

 

A Quick Guide to Sending Push Notifications

Being able to send Push Notifications to users is one of the fundamental capability in an enterprise mobile app. Appery.io platform comes with Push Notifications component out-of-the-box and allows you quickly to send targeted messages to iOS and Android devices. In this blog post we will show the four ways to send a Push Notification message to a user:

  1. Push Notifications Console.
  2. Server Code Push Notifications API (server-side).
  3. Push Notification REST API.
  4. Customer Console.

Push Notifications Console

This first option is probably the simplest way to send a Push Notifications once you have installed an app on a device. Select device types, enter the message and send. The Push Notification message should arrive on the registered device instantly.

 

PN_console.png
Push Notifications console.

 

Continue reading “A Quick Guide to Sending Push Notifications”

Quickly Invoke Lyft API from Appery.io Server Code

Appery.io Server Code makes it simple to invoke any external REST API. In this blog post, I will show you how to invoke Lyft API. I will use the Ride Types API to show what types of cars are available based on a location – latitude and longitude. Lyft is a ride sharing company that’s disrupting car ownership and moving forward with self-driving cars initiative.

Let’s start with the tutorial.

The first step is to perform authentication to get an access token to invoke any Lyft API. As the Ride Types API doesn’t use any user data, you can use client credentials for authentication. The script to get an access token looks like this:

var url = "https://api.lyft.com/oauth/token";
var client_id = "<client_id>";
var client_secret = "<client_secret>";

var XHRResponse = XHR2.send("POST", url, {
  "body": {
    "grant_type": "client_credentials",
    "scope": "public"
  },
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Basic "+encodeBase64(client_id+":"+client_secret)
  }
});
Apperyio.response.success(XHRResponse.body, "application/json");

The response will look like this:

{
   "expires_in": 86400,
   "token_type": "Bearer",
   "scope": "public",
   "access_token": "<access_token>"
}

Once you have the access_token, it is as simple to invoke the Ride Types API:

var url = "https://api.lyft.com/v1/ridetypes"; // REST API URL

var XHRResponse = XHR2.send("GET", url, {
  "parameters": {
    "lat": "37.7833", // San Francisco
    "lng": "-122.4167"
  },
  "headers": {
    "Authorization": "Bearer " + &lt;access_token&gt;
  }
});
Apperyio.response.success(XHRResponse.body, "application/json");

The response looks like this, it shows the type of rides available in San Francisco: Lyft, Lyft Line, and Lyft Plus.

{
	"ride_types": [{
		"ride_type": "lyft_line",
		"pricing_details": {
			"cost_per_minute": 23,
			"base_charge": 200,
			"currency": "USD",
			"trust_and_service": 175,
			"cost_per_mile": 115,
			"cancel_penalty_amount": 500,
			"cost_minimum": 475
		},
		"image_url": "https://s3.amazonaws.com/api.lyft.com/assets/car_standard.png",
		"seats": 2,
		"display_name": "Lyft Line"
	}, {
		"display_name": "Lyft",
		"image_url": "https://s3.amazonaws.com/api.lyft.com/assets/car_standard.png",
		"pricing_details": {
			"cost_minimum": 500,
			"cost_per_minute": 23,
			"base_charge": 200,
			"currency": "USD",
			"trust_and_service": 175,
			"cost_per_mile": 115,
			"cancel_penalty_amount": 500
		},
		"ride_type": "lyft",
		"seats": 4
	}, {
		"display_name": "Lyft Plus",
		"ride_type": "lyft_plus",
		"image_url": "https://s3.amazonaws.com/api.lyft.com/assets/car_plus.png",
		"seats": 6,
		"pricing_details": {
			"currency": "USD",
			"cost_minimum": 700,
			"cost_per_mile": 200,
			"trust_and_service": 175,
			"cancel_penalty_amount": 500,
			"cost_per_minute": 30,
			"base_charge": 300
		}
	}]
}

Want to learn how to build mobile apps fast? Check out the Appery.io YouTube channel for videos.

Video Tutorial: How to Build and Test a Complete Mobile App with API Backend

This video shows how to build and test a complete Ionic app with an API backend. The tutorial starts by showing how to create an app backend with API Express by connecting to an external REST API. Then, the tutorial shows how to build an Ionic app and import the backend service into the app. The tutorial also shows how to make a small change to the generated code. The tutorial then shows how to test the app in the browser and also on a device using the Appery.io Tester app. Lastly, the tutorial shows where to build a binary file for iOS or Android for submission to an app store.

Check out other videos on how to build mobile apps fast.

Learn How to Perform Basic Database Operations: Create, Read, Update, and Delete

The Appery.io Backend Services consists of the following components:

  • Database – for storing any app data.
  • Server Code – for writing server-side app logic using JavaScript.
  • API Express – integrating with external systems and APIs.
  • Push Notifications – sending push messages to devices.
  • Web Hosting – publishing and hosting mobile web apps.

In this post, we will show you how a Server Code script integrates with the Database.

One of the most common questions we get is how to work with the database, how to create, edit and delete data. This makes sense as virtually any mobile app needs to store data in a database and perform these basic operations. To access the database, we are going to use Server Code script. Server Code allows writing app logic using JavaScript which will be executed on the server. For example, a script can access the database, send a Push Notification message, sort data and invoke an external REST API. We will start with the most basic operation: how to read data from the database.

The database collection used in this post looks like this:

crud_collection
Database collection.

This can be data collected from a form inside an app – a form that collects information about the user.

Reading Data

Server Code script has out-of-the-box API to access the database to perform all the basic operations. The following script reads all objects from the above collection.

var dbApiKey = "fe7c124b-f7c5-4764-9274-173b56a97102";
var result = Collection.query(dbApiKey, "Data");
Apperyio.response.success(result, "application/json");

One line 2, the script retrieves all the data.

One line 3, the script response is set. A Server Code script is invoked as a REST API. The code on this line defines the API response.

A script can be quickly tested from the Run tab where you can see the JSON data:

 

crud_test
Script testing.

 

Reading data from a database collection is fast and simple. Next, we are going to save data into the database.

Continue reading “Learn How to Perform Basic Database Operations: Create, Read, Update, and Delete”