APIs
Purpose:
ReachPlanet provides API (Application Program Interface) access to view non-secure data sources to clients for use in their own personal or church applications. Below you will find authentication and endpoint information to the following data:
Events - we use this data to show and create an upcoming events calendar on our church website
Media - we use this data to show YouTube videos, mp3 audio sermons and other documents that we store in ReachPlanet
Users - we use this data to check if contacts exists and to add them from a contact or registration form.
If there are data points that you'd like to access that are not listed please set up a help ticket in our help system for the request and we'll get back to you promptly.
API Authentication:
In order to access any of the methods listed below you will need to access and store your oToken in a secure location.
The oToken is available under Group/Settings/Defaults
If you feel your oToken has been compromised or a change in staff may result in a compromise, you may re-generate your oToken by clicking the 'Re-Generate Token'
Data access:
Each of the methods listed below returns a json response from a web request.
Events:
Event Categories used to populate a dropdownlist or to filter Events
End Point:nbsp; https://reachplanet.com/api.aspx?eventCategories&oToken={myToken}
- returns json list of eventCategories
Events >= to current date.
End Point:nbsp; https://reachplanet.com/api.aspx?events&oToken={myToken} - returns json list
Events by event type (category from event categories)
End Point:nbsp; https://reachplanet.com/api.aspx?eventsByCategory&category={eventCategory}&oToken={myToken} - returns json list
Events Data Dictionary:
- eventId Long(bigint)
- EventTitle String
- EventDateDate
- EndDateDate
- RecurTypeStringOnce, Multi-Day,Weekly, Monthly, Annually
- RecursDayStringWeekdays - Sunday - Saturday
- EventTimeString
- EndTimeString
- EventDescString
- LocationNameString
- LocationNickNameString
- LocationTypeString
- Address1String
- CityString
- StateString
- ZipCodeString
- ContactString
- CategoryString
Media:
Media Types used to populate a dropdownlist or to filter Media links
End Point:nbsp; https://reachplanet.com/api.aspx?mediaTypes&oToken={myToken} - returns json list of mediaTypes for client
Media Categories Data Dictionary:
- Category String
End Point:nbsp; https://reachplanet.com/api.aspx?mediaByType&mediaType={mediaType}&oToken={myToken}
Media Data Dictionary:
- id Long(bigint)
- Url String
- videoDate Date
- Series String
- Type String
- theme String
- subject String
- speaker String
- description String
- imgUrl String
- labels String
Users:
Email exists - test to see if form data; email exists in the database
End Point:nbsp; https://reachplanet.com/api.aspx?emailExists={userEmail}&oToken={myToken} returns number > 0 = exists
Phone exists - test to see if form data; phone number exists in the database
End Point:nbsp; https://reachplanet.com/api.aspx?phoneExists={userPhone}&oToken={myToken} returns number > 0 = exists
Add User - add a new user (if doesn't exist)
End Point:nbsp; https://reachplanet.com/api.aspx?addUser&email={userEmail}&firstName={firstName}&lastName={lastName}&phone={userPhone}&city={city}&state={state}&zip={zip}&country={country} - return userId (long)
Required Fields:
- email
- firstname
- lastname
- phone
Error Codes:
Code | Value | Description |
101 |
Bad Token |
Doesn't exist |
201 |
Bad Request |
Required parementer not provided |
301 |
Bad Request |
There is no data |
400 |
Bad Request |
See response for details |
500 |
Not Found |
Check the Documentation for endpoints |
Code Examples
Asp.net - VB.NET
... imports NewtonSoft.json
... imports System.IO
... imports System.WEb.Configuration
Dim result as string = ""
Dim oToken as string = System.Configuration.ConfigurationManager.AppSettings("oToken")
Dim myUrl as string = "https://reachplanet.com/api.aspx?events=Get&oToken=" & oToken
Dim request as Web Request = HttpWebRequest.Create(myUrl)
With request
.Method = "GET"
.ContentType = "application/x-www-form-urlencoded"
End With
Dim response as WebResponse = request.getResponse()
Using sr = New StreamReader(response.GetResponseStream())
result = sr.ReadToEnd()
End Using
Dim jsonResult as new JObject
jsonResult = JsonConvert.DeserializeObject(result)
' parse json response and use it as you wish in your applications.