Web API

 

Requesting data with the REST API

Enables you to request subject data for a single subject.

 

You can get all data for a subject, or you can get data from specific visits and eForms.

 

This supersedes the original Web API call.

 

You must include an authorization token in this request which is generated from the /token call.

URL

http://localhost/MACRORESTAPI/getsubjectdata/[parameters]

Method

GET

Parameters

You must complete all parameters, unless you are shortening the URL to only request data from an entire subject, as shown in the examples below.

 

Parameter

Type

Description

study

string

Study name

site

string

Site code

subject

integer

Subject ID

visit

string

Visit code - if left empty,this will return data for all visits in the subject

visitcycle

integer

Visit cycle - if set to '0', this will return data for all cycles of the visit

If you specify a cycle that does not exist, the API call is deemed successful but no data is returned with the subject header

eForm

string

eForm code - if left empty, this will return data for all eForms in the visit

eFormcycle

integer

eForm cycle - if set to '0', this will return data for all cycles of the eForm

If you specify a cycle that does not exist, the API call is deemed successful but no data is returned with the subject header

Response

Examples

To get data from a specific eForm cycle:

 

GET https://localhost/MACRORESTAPI/api/subjectdata/getsubjectdata/study/Demostudy/site/london/subject/21/visit/screening/visitcycle/2/eform/cover/eformcycle/1

 

To get data from an entire eForm:

 

GET https://localhost/MACRORESTAPI/api/subjectdata/getsubjectdata/study/Demostudy/site/london/subject/21/visit/screening/visitcycle/2/eform/cover/eformcycle/0

 

To get data from a specific visit cycle:

 

GET https://localhost/MACRORESTAPI/api/subjectdata/getsubjectdata/study/Demostudy/site/london/subject/21/visit/screening/visitcycle/3

 

To get data from an entire visit:

 

GET https://localhost/MACRORESTAPI/api/subjectdata/getsubjectdata/study/Demostudy/site/london/subject/21/visit/screening/visitcycle/0

 

To get all data for the subject:

 

GET https://localhost/MACRORESTAPI/api/subjectdata/getsubjectdata/study/Demostudy/site/london/subject/21

 

 

Successfully retrieved data is provided in the return message.

Return to top

 

Result codes

Code

Value

Description

0

Success

The operation was successful

1

InvalidInput

The visit or eForm code is invalid

2

SubjectNotExist

The subject could not be found  

3

SubjectNotOpened

The subject could not be accessed 

4 InvalidUserCredentials The current user does not have the relevant MACRO permissions to access the study/site

 

Return to top

 

Related Topics