Skip to content

API Reference

APIs

Administrator Authentication

POST     /api/register

  • Register an admin for o-RDS
Response CodeDescription
201User Created
400Missing Fields
409User Already Created
500Internal Server Error

POST     /api/login

  • Login to o-RDS
Response CodeDescription
200Login Successful
404Email and password combination invalid
500Internal Server Error

Survey Routes

GET     /api/survey/{surveyID}

  • Retrieve a survey configuration

API Parameters

surveyID - The unique identifier for a survey ID

Response CodeDescription
200Survey Retrieved
404Survey Doesn’t Exist
500Internal Server Error

GET     /api/surveys

  • Retrieve all surveys
Response CodeMessage
200Surveys Found
403Unauthorized Access
404User does not exist

POST     /api/survey/{surveyID}

  • Update or create a survey with the provided ID

API Parameters

surveyID - The unique identifier for a survey ID

Required Body Fields

surveyData - Contains the survey configuration object

Response CodeMessage
201Survey created or overwritten
403Unauthorized Access
500Internal server error

DELETE     /api/survey/{surveyID}

  • Delete a survey with the provided ID

API Parameters

surveyID - The unique identifier for a survey ID

Response CodeMessage
200Survey Deleted
403Unauthorized Access
404Survey does not exist
500Internal server error

Response Routes

GET     /api/survey/{surveyID}/repsonse/{alias}

  • Retrieves the response of a specific person

API Parameters

surveyID - The unique identifier for a survey ID

alias - A survey takers unique, nonidentifiable number

Response CodeMessage
200Response found
404Response doesn’t exist
500Internal server error

GET     /api/survey/{surveyID}/responses

  • Retrieves all responses for a survey

API Parameters

surveyID - The unique identifier for a survey ID

Response CodeMessage
200Responses found
403Unauthorized Access
404Survey doesn’t exist
500Internal server error

POST     /api/response

  • Creates a survey response

Required Body Fields

surveyID - Contains the ID of a survey

alias - Contains the alias associated with the response

responseData - Contains a particpants responses

parentHash - Contains the hash of the parent to track referral chains

Response CodeMessage
200Responses found
201Response created or overwritten
403Unauthorized Access
404Survey or alias does not exist
409Referral link at max uses
500Internal server error

DELETE     api/response    

  • Deletes a response

NOTE: CURRENTLY NOT IMPLEMENTED


Incentive Routes

POST     /api/incentive

  • Creates a hash to represent a paricpant for use in referral incentives

Required Body Fields

surveyID - Contains the ID of a survey

Response CodeMessage
201Hash Created
400Invalid request, missing surveyID
409No incentive found
500Internal server error

GET     /api/survey/{surveyID}/incentive

  • Retrieve incentive information using a hash representing a particpant’s incentives
Response CodeMessage
200Incentive information found
400Invalid request, missing surveyID
404Hash does not exist
500Internal server error

Other Routes

POST     /api/alias

  • Creates an alias for a specific survey using the surveyID

Required Body Fields

surveyID - Contains the ID of a survey

Response CodeMessage
201Alias created
400Invalid request, missing surveyID
500Internal server error

PATCH     /api/user-remove

  • Removes a user from a survey

Required Body Fields

surveyID - Contains the ID of a survey

userID - Contains the ID of the user to be removed from a survey

Response CodeMessage
400Invalid request, missing surveyID or email
404User or survey does not exist
500Internal server error

PATCH     /api/user-add

  • Adds a user to a survey

Required Body Fields

surveyID - Contains the ID of a survey

userID - Contains the ID of the user to be removed from a survey

Response CodeMessage
400Invalid request, missing surveyID or email
404User or survey does not exist
500Internal server error

Tremendous Routes

GET /api/tremendous/listCampaigns

  • Retrieves all campaigns associated with the users account
Response CodeMessage
200Campaigns Found
500Internal server error

GET     /api/listFundingSources

  • Retreives all funding sources associated with the users account
Response CodeMessage
200Funding Sources Found
500Internal server error

POST     /api/survey/{surveyID}/sendPayment/{mode}

  • Sends a payment using Tremendous’ API with the provided method

API Parameters

surveyID - Contains the ID of a survey

mode - The method in which someone like to recieve their incentive

Required Body Fields

funding_source_id - Contains the id of the funding source used for this incentive payout

campaign_id - Contains the id of the campaign Tremendous will use to send the incentive payout

denomination - Contains the amount that will be paid out

recipient - An object that contains a recipient’s name and email

method - Contains the method in which a recipient will recieve their payout

Response CodeMessage
200Reward paid
400Invalid mode
400Unable to claim reward
500Internal server error

Twilio Routes

POST     /api/twilio/verfication

  • Verifies a phone number is real

Required Body Fields

to - Contains a particpant’s phone number and sends their OTP code

Response CodeMessage
200Survey taker registered successfully. Verification code has been sent.
400Invalid phone number
500Internal server error

POST     /api/twilio/verficationCheck

  • Verifies a participant’s OTP code

Required Body Fields

to - Contains a particpant’s phone number

code - Contains the code entered by a participant

Response CodeMessage
200Survey taker verification successful
401Invalid code
404Survey taker not found
500Internal server error