Skip to content

Server API

Will Davies edited this page Oct 3, 2018 · 9 revisions

Information

All calls to the server should be made using an HttpConnection with URL parameters.

A Java implementation of this API is available at: https://github.com/wdavies973/RobluCloud-API

General parameter and miscellaneous definitions:

  • code is the unique string used to identify teams, it's a secret code that only team members should use, it determines which team's data should be modified in the requests below.
  • time generally refers to the milliseconds UNIX time stamp of the last successful sync, if the server's internal time stamp is greater than the time parameter, it will return updated information, otherwise, nothing will be returned. Note: the server will divide every milliseconds time stamp by 1000 to get seconds so it doesn't need to store as big of numbers.
  • Parameters should be added to the end of the server's IP address, the official cloud IP address is: http://ec2-13-59-164-241.us-east-2.compute.amazonaws.com/. See the /sync/cloud/API in Roblu Scouter to see a working Java implementation of the Roblu Cloud API.
  • auth is the unique random string used to identify server admins that have elevated privileges
  • Roll: "Master" means the method is primarily used by Roblu Master, "Scouter" means the method is primarily used by Roblu Scouter.

Teams

  • GET /teams/getTeam
    • Parameters: code
    • Returns: Team model (FRC number, active_event_name, last_ui_edit, last_edit, active, form, ui)
    • Roll: Scouter
  • GET /teams/isActive
    • Parameters: code
    • Returns: true if the client should continue to sync with the server
    • Roll: Scouter
  • GET /teams/regenerateCode
    • Parameters: code
    • Returns: newly regenerated code for the team
    • Roll: Master
  • POST /teams/pushForm
    • Parameters: content containing serialized, compressed RForm model
    • Returns: none
    • Roll: Master
  • POST /teams/pushUI
    • Parameters: content containing serialized, compressed RUI model
    • Returns: none
    • Roll: Master

Checkouts

  • POST /checkouts/init
    • Description: Sets all the parameters to the team model, updates its timestamp, and sets the team model to active
    • Parameters: code, number (FRC team number), active_event_name, form, ui
    • Roll: Master
  • GET /checkouts/purge
    • Description: Tells the server to stop managing the event, the event will be deleted, and all Roblu Scouters will be cleared
    • Parameters: code - Team code, for authentication
    • Used by: Roblu Master
  • POST /checkouts/pushCheckouts
    • Parameters:
      • code - Team code, for authentication
      • content serialized array of RCheckout models
    • Returns: nothing
    • Used by: Roblu Scouter
  • GET /checkouts/pullCheckouts
    • Pulls a list of checkouts on the server, filtered by timestamp
    • Parameters:
      • code - The team code, for authentication
      • teamNumber (Optional) - If the team has opted in, the teamNumber may be used to obtain read-only data instead of code.
      • pullAll (Optional) - set to true to return all checkouts regardless of timestamp (syncIDs is not required if this parameter is provided)
      • syncIDs - A serialized array of checkout ID and their corresponding timestamp (the last time they were pulled). Look here for the proper serialization technique.
    • Example return
    • Used by: Roblu Scouter
  • GET /checkouts/pullCompletedCheckouts
    • Pulls a list of checkouts from the server, filtered by timestamp & status (=completed)
    • Parameters:
      • code- The team code, for authentication
      • syncIDs - A serialized array of checkout ID and their corresponding timestamp (the last time they were pulled). Look here for the proper serialization technique.
    • Returns: The same as checkouts/pullCheckouts except checkouts have a status like: (3, "completed")
    • Usedy by: Roblu Master

Admin

  • GET /admin/getTeam
    • Parameters: auth, ownerEmail
    • Returns: the requested team model
  • GET /admin/createTeam
    • Parameters: auth, ownerEmail, secret, officialName
    • Returns: the newly created team
  • GET /admin/deleteTeam
    • Parameters: auth, ownerEmail, officialName
    • Returns: the deleted team
  • GET /admin/regenerateCode
    • Parameters: auth, officialName, ownerEmail
    • Returns: new team code

Examples of raw JSON response

Clone this wiki locally