Web Integration Configuration:

Referral API

Connect your own web form to submit into your CTMS database with the Referral API.

Referral API

This is a demonstration of a custom study page using your own web form that submits the study applicant’s info directly into the CTMS database via the Referral API.

This method completely bypasses the standard web integration script embeds, allowing you to utilize your own custom study pages and web forms while still submitting applicant info directly into your CTMS database.

All the information on this page is generated by the website itself, including the form on the right (below on mobile).

Apply to Participate

This is a demo, not a real application form. You will not be contacted by anyone if you submit this form.

Web Integration Instructions:

Referral API

Getting Started: You will need the RTID and the API Key of an existing RealTime CTMS. To request your organization’s RTID, API Key, or ask any other questions about the API Referral, please contact RealTime support.

The RealTime CTMS Referral APIs allow 3rd party clients to submit referrals to a CTMS system via a RESTful API request.

BaseURL

The baseUrl used with API endpoints is determined based on the RealTime server your system is hosted on and your site ID. For assistance with this URL please contact RealTime Support at support@realtime-ctms.com.

baseUrls look similar to https://{domain-here}/{site-ID}/web/v1/{endpoint path}

Authentication/Authorization

All requests made to the various endpoints must include an Authorization header for a Bearer token (the publishable API key). An example Authorization header in a request would look like  Authorization: Bearer <publishable key here> 

Your publishable key is provided by RealTime. This key is publishable, which means it’s safe for embedding in client web and mobile applications.

AUTHORIZATION (Bearer Token)

Token

<token>

POST /studies/apply

 /studies/apply 

Sends a subject referral to the CTMS system to be added. Duplicate checks are performed to determine whether the subject is already in the system. If phone number verification is enabled a verification check will be performed. If RealTime Text is enabled, subjects with a phone number determined to be a mobile number will be opted in to receive text messages for appointment reminders and optionally marketing texts (based on system configuration).

Note regarding questions[]: The question ID is not exposed via this endpoint and requires an additional API. Contact support@realtime-ctms.com for more information.

Required Fields

By defualt the following 6 fields are required:

  • StudyID
  • FirstName
  • LastName
  • EMail
  • Phone
  • ReferrerID

Additional fields can be made to be required by the configurations options for the Web Integration located in the CTMS under Administration > Configurations > Web Integration > Display Advanced Web Application Form.

URL Encoding

For the best success in the POST, make sure to url encode the data when making the POST.

AUTHORIZATION Bearer Token

This request is using Bearer Token from collection RealTime CTMS Referral API

HEADERS

Content-Type

application/x-www-form-urlencoded

Authorization
publishable key/token

BODY urlencoded

StudyID
Required. The ID of the study the subject is applying to.
FirstName
Required. Subject’s first name
LastName
Required. Subject’s last name
EMail
Required. Email address
Phone
Required. Primary phone number. If phone verification is enabled then there will be a verification attempt. If RealTime TEXT is enabled the subject will be opted into appointment texts.
ReferrerID
Required. Referral source selected by subject.
_ContactTime[]
Best time of day to contact subject. Typical options are:
  • Morning (8-11AM)
  • Lunchtime (11AM-1PM)
  • Afternoon (1-5PM)
  • Evening (After 5PM)
_ContactMethod
Best contact method for subject, e.g. txt, phone, etc.
Gender
Gender as M or F
DOB
Date of birth formatted as YYYY-MM-DD
ZipCode
ZIP or postal code. May be required based on system configuration.
medicalhistory[]
List of medical conditions for subject.
socialhistory[]
List of social conditions for subject.
medications[]
List of medications taken by subject.

questions[]

Requires Question ID. Question ID and Answer value pairing for Global and Study specific questions. 0: No, 1: Yes, 2: N/A, 3: unanswered -.

Example Request /studies/apply

				
					curl --location '/studies/apply' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: publishable key/token' \
--data-urlencode 'StudyID=58' \
--data-urlencode 'FirstName=Firstname' \
--data-urlencode 'LastName=Lastname' \
--data-urlencode 'EMail=email@domain.com' \
--data-urlencode 'Phone=5335335335' \
--data-urlencode 'ReferrerID=4' \
--data-urlencode '_ContactTime%5B%5D=' \
--data-urlencode '_ContactMethod=' \
--data-urlencode 'Gender=' \
--data-urlencode 'DOB=' \
--data-urlencode 'ZipCode=' \
--data-urlencode 'medicalhistory%5B%5D=' \
--data-urlencode 'socialhistory%5B%5D=' \
--data-urlencode 'medications%5B%5D=' \
--data-urlencode 'questions%5B%5D='
				
			

Example Response (json)

Body

				
					{
  "status": 0,
  "PatientID": 185,
  "message": "Referral has been added to study."
}
				
			

Headers

Date
Wed, 07 Aug 2024 16:20:02 GMT
Content-Type
application/json
Transfer-Encoding
chunked
Connection
keep-alive
Server
nginx
Content-Security-Policy
frame-ancestors ‘self’
X-Frame-Options
SAMEORIGIN
Expires
Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control
no-store, no-cache, must-revalidate
Pragma
no-cache
Access-Control-Allow-Methods
POST, GET, OPTIONS
Access-Control-Allow-Headers
Access-Control-Allow-Origin
*
Strict-Transport-Security
max-age=63072000
X-Content-Type-Options
nosniff
X-XSS-Protection
1; mode=block

GET /lists/conditions

/lists/conditions

Returns a list of medical history conditions enabled for web referral use.

Response data fields:

"Name": The name of the Medical History condition.

AUTHORIZATION Bearer Token

This request is using Bearer Token from collection RealTime CTMS Referral API

HEADERS

Content-Type

application/x-www-form-urlencoded
Authorization
publishable key/token

Example Request /lists/conditions

				
					curl --location '/lists/conditions' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: publishable key/token'
				
			

GET /lists/social-conditions

/lists/social-conditions

Returns a list of social history conditions enabled for web referral use.

Response data fields:

"Name": The name of the Social History condition.

AUTHORIZATION Bearer Token

This request is using Bearer Token from collection RealTime CTMS Referral API

HEADERS

Content-Type

application/x-www-form-urlencoded

Example Request /lists/social-conditions

				
					curl --location '/lists/social-conditions' \
--header 'Content-Type: application/x-www-form-urlencoded'
				
			

GET /lists/medications

/lists/medications

Returns a list of medications.

Response data fields:

"Name": The name of the medication.

AUTHORIZATION Bearer Token

This request is using Bearer Token from collection RealTime CTMS Referral API

HEADERS

Content-Type

application/x-www-form-urlencoded

Example Request /lists/medications

				
					curl --location '/lists/medications' \
--header 'Content-Type: application/x-www-form-urlencoded'
				
			

GET /lists/studies

/lists/studies

Returns a list of studies within the CTMS that have a web-enabled status.

Response data fields:

StudyID: The Study’s ID
Sponsor: Sponsor name
Protocol: The Protocol text
CompleteProtocol: The Protocol title
Description: The clinical description
Title: Website title, found under Website Information
Comment: Website Description, found under Website Information
PrimaryIndication: Study’s indication
Thumb: Thumbnail image from Image 1, found under Website Information
Image1: Image 1, found under Website Information
Image2: Optional Image 2, found under Website Information
Flyer: Flyer image, found under Website Information
Keyword: Website Keywords, found under Website Information
WebStory: Study Landing Page Information, found under Website Information
RecruitmentNote: Recruitment Notes
EnterpriseID: Enterprise ID if attached to an Enterprise system. Defaults to 0
UniqueID: Combination of CTMS name and study ID
Status: Study’s status
EnrollmentCloseDate: Enrollment End date
PrincipalInvestigator: Principal Investigator’s First and Last Name

AUTHORIZATION Bearer Token

This request is using Bearer Token from collection RealTime CTMS Referral API

HEADERS

Content-Type

application/x-www-form-urlencoded

Example Request /lists/studies

				
					curl --location '/lists/studies' \
--header 'Content-Type: application/x-www-form-urlencoded'
				
			

GET /lists/referral-sources

/lists/studies

Returns a list of referral sources present in the system and configured for use during application.

Append ?RemoveFilter to the request to show more results (non-campaign sources).

Response data fields:

ReferrerID: Referral source’s ID
Referrer: The Referral source’s name

AUTHORIZATION Bearer Token

This request is using Bearer Token from collection RealTime CTMS Referral API

HEADERS

Content-Type
application/x-www-form-urlencoded

PARAMS

RemoveFilter

(Optional) When present (any value), will remove filtering from result set.

Example Request /lists/referral-sources

				
					curl --location '/lists/referral-sources' \
--header 'Content-Type: application/x-www-form-urlencoded'
				
			

POST /referral-source

/referral-source

Add a new Referral Source to the system. The return message provides the newly created ID.

AUTHORIZATION Bearer Token

This request is using Bearer Token from collection RealTime CTMS Referral API

Body urlencoded

Referrer
Required. Name of new Referral Source, 200 character limit.
publishableApiKey
Required. API token/key

Example Request /lists/referral-sources

				
					curl --location '/referral-source' \
--data-urlencode 'Referrer=' \
--data-urlencode 'publishableApiKey='
				
			

GET /reports/patient-statuses

/reports/patient-statuses

List of patients by each Recruitment and Enrollment Status.

Response data fields:

MRN: The Subject’s MRN and ID number
PatientCustomID: Returns null
EnterpriseStudyID: Enterprise ID if attached to an Enterprise system. Defaults to 0
UniqueStudyID: Combination of CTMS name and Study ID. The Study ID will be the number after the “-“
RecruitmentStatus: Subject’s recruitment status
EnrollmentStatus: Subject’s enrollment status
Referrer: Referral source’s name
ReferrerID: Referral source’s ID
FirstName: Subject’s first name
LastName: Subject’s last name
DOB: Subject’s date of birth in the YYYY-MM-DD format

AUTHORIZATION Bearer Token

This request is using Bearer Token from collection RealTime CTMS Referral API

Example Request /reports/patient-statuses

				
					curl --location '/reports/patient-statuses'
				
			

GET /reports/patient-statuses/by-id

/reports/patient-statuses/{patientID}

List of patients by each Recruitment and Enrollment Status

Response data fields:

SubjectID: The Subject’s MRN number
StudyID: The numerical identifier for the Study, created and used by the CTMS
RecruitmentStatus: Subject’s recruitment status
EnrollmentStatus: Subject’s enrollment status
Referrer: Subject’s referrer
ReferrerID: Referrer’s numerical ID

AUTHORIZATION Bearer Token

This request is using Bearer Token from collection RealTime CTMS Referral API

Example Request /reports/patient-statuses/by-id

				
					curl --location -g '/reports/patient-statuses/{patientID}'
				
			

Access the Report

Complete the form below to access the full report.