RocketJourney Documentation logo

Welcome

Here you’ll find everything you need to develop for the RocketJourney Platform.

This will allow your club, or your client’s club, to offer RocketJourney to its members.

What you need

To offer RocketJourney to the members of a Club, your software has to be able to do 2 things:

  • Member Verification: Verify that a RJ User is a Member of the Club.
  • Check-In Verification: Send Check-In information to RJ in real time.

If you are software provider for clubs, and want to make your software RocketJourney Ready, you’ll also need to build a Configuration UI on your software’s Admin Panel. This Configuration UI will allow the Club Admin to configure a connection between RocketJourney and your software.

Authentication

For all requests to the RocketJourney Platform API, you need to provide the Club’s Token inside a X-RJ-Token HTTP header.

For requests made by RocketJourney to your software, we will provide the same Club’s Token inside a X-RJ-Token HTTP header. This is optional, but recommended.

You can find your Token on the Settings tab of your Control Center or, if you are a software provider, contact us at support@rocketjourney.com to receive one.

Verifying Members

RocketJourney Users need to verify they are Members of the Club they want to connect to in the RocketJourney App.

To be able to verify members, your software has to expose a web service with an endpoint URL accessible to RocketJourney, that accepts a POST request containing a JSON with a member’s email address.

The web service will receive:

POST /verify HTTP/1.1
Content-Type: application/json
X-RJ-Token: 3f5554b5-13d6-40bd-b0c6-a0095b41b4ed

{
  "email": "fitness.user@gmail.com"
}
curl -X "POST" "http://www.globogym.com/verify" \
     -H "X-RJ-Token: 3f5554b5-13d6-40bd-b0c6-a0095b41b4ed" \
     -H "Content-Type: application/json" \
     -d $'{
  "email": "member@mail.com"
}'

And the web service should respond:

If email does not exist in Club’s database:

A 404 response.

If email exist:

A 200 response, with the following body:

{
  "id": "123456",
  "status": "active / inactive"
}
Parameters
id
String
The web service should respond with the Member’s Unique ID linked to that email.
status
String
“active” if Member is able to pass the Club’s access control.
“inactive” if Member is not able to pass the Club’s access control (cancelled membership, stopped paying, or some other reason).

About the Authorization Token: We will be sending your Global Token inside a X-RJ-Token header, so you can validate that requests are sent from our systems, if you wish to do so.

F.A.Q.

What to do if an email is linked to multiple IDs?

Sometimes a Member may have 2 or more memberships with the same registered email.

We realize each system works differently, but here’s a suggestion to tackle this issue:

  • If only 1 ID is active, return that ID
  • Else, return the last updated/used ID

What does RJ do after a 404 response?

We ask the RJ User to approach the Club’s front desk to add or change his or her email. Ideally, the new email is immediately accessible to the Member Verification web service.

This is convenient for the Club, since having Members’ correct emails is very valuable.

// We can move this to the responses above.

What does RJ do after a 200 response?

We send a verification link to the email. If the email is verified, we link the RJ User to his or her Member Unique ID. From that point forward, his or her Check-Ins automatically start counting toward the game.

// We can move this to the responses above.

How does the Club Admin configure the Member Verification service?

The Club Admin must input the web service’s endpoint URL in the Settings tab of the Club’s Control Center.

If you are a software provider, you must show the Club’s Endpoint URL on your software’s RocketJourney Configuration UI. (Optional Mockups can be found later in this guide)

Veryfing Check-Ins

To verify Check-Ins, your software has to send Check-In information to RocketJourney in real time as Members check in at the Club.

A POST request has to be sent to rocketjourney.com/api/v1/check with the following information:

POST /check HTTP/1.1
Content-Type: application/json
X-RJ-Token: 3f5554b5-13d6-40bd-b0c6-a0095b41b4ed

{
  "member_id": "541",
  "location_id": "44",
  "check_in_date": "1488423886"
}
curl -X "POST" "http://www.globogym.com/verify" \
     -H "X-RJ-Token: 3f5554b5-13d6-40bd-b0c6-a0095b41b4ed" \
     -H "Content-Type: application/json" \
     -d $'{
  "email": "member@mail.com"
}'

___________ Temporal Examples

Welcome to our API.

This API document is designed for those interested in developing for our platform.

This API is still under development and will evolve.

You’ll succeed if you do this.

Here’s some useful information.

Something may not happen if you try and do this.

Something bad will happen if you do this.

Authentication

You need to be authenticated for all API requests. You can generate an API key in your developer dashboard.

Add the API key to all requests as a GET parameter.

Nothing will work unless you include this API key

Status Codes

Code Name Description
200 OK Success
201 Created Creation Successful
400 Bad Request We could not process that action
403 Forbidden We couldn’t authenticate you

All errors will return JSON in the following format:

{
  "error": true,
  "message": "error message here"
}

/books

List all books

Parameters
offset
Offset the results by this amount
limit
Limit the number of books returned

This call will return a maximum of 100 books

Lists all the photos you have access to. You can paginate by using the parameters listed above.

$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
  alert(data);
});
r = requests.get("http://api.myapp.com/books/", token="YOUR_APP_KEY")
print r.text
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
  if (!error && response.statusCode == 200) {
    console.log(body);
  }
});
curl http://sampleapi.readme.com/orders?key=YOUR_APP_KEY

/books

Create Book

Parameters
title
The title for the book
score
The book’s score between 0 and 5

The book will automatically be added to your reading list

Adds a book to your collection.

$.post("http://api.myapp.com/books/", {
  "token": "YOUR_APP_KEY",
  "title": "The Book Thief",
  "score": 4.3
}, function(data) {
  alert(data);
});

/books/:id

Get Book

Returns a specific book from your collection

$.get("http://api.myapp.com/books/3", {
  token: "YOUR_APP_KEY",
}, function(data) {
  alert(data);
});

/books/:id

Update Book

Parameters
title
The title for the book
score
The book’s score between 0 and 5

Update an existing book in your collection.

$.ajax({
  "url": "http://api.myapp.com/books/3",
  "type": "PUT",
  "data": {
    "token": "YOUR_APP_KEY",
    "score": 5.0,
    "title": "The Book Stealer"
  },
  "success": function(data) {
    alert(data);
  }
});

/books/:id

Deletes a book

Deletes a book in your collection.

$.ajax({
  "url": "http://api.myapp.com/books/3",
  "type": "DELETE",
  "data": {
    "token": "YOUR_APP_KEY"
  },
  "success": function(data) {
    alert(data);
  }
});