Skip Headers

Oracle® Health Sciences ClearTrial Cloud Service Web Services API User Guide Release 5.0 Part Number E39879-01 |
Home | Book List | Contents | Contact Us

Previous | Next
| View PDF

# 2 Compound Resource API

This ClearTrial Web Services API enables you to view compounds accessible to the current user for a given customer ID. Compounds are products and include drugs and medical devices.

## 2.1 Get Compounds

Lists the compounds accessible to the current user for a given customer ID.

Method: GET

URL: /cleartrial-ws/compounds

Sample output in JSON:

    {
      "compound":[
          {
            "id":10201,
            "name":"Test Compound",
            "code":"ABC-123",
            "description":"test",
            "createdBy":"administrator",
            "createdDate":"15-Apr-2010",
            "lastModifiedBy":"administrator",
            "lastModifiedDate":"15-Apr-2010",
            "url":"/cleartrial-ws/compounds/10201"
          },
         {
            ...
            ...
         },
         ...
         ...
       ]
    }

Sample output in XML:

    <compoundRepresentations>
        <compound>
             <id>10201</id>
             <name>Test Compound</name>
             <code>ABC-123</code>
             <description>test</description>
             <createdBy>administrator</createdBy>
             <createdDate>15-Apr-2010</createdDate>
             <lastModifiedBy>administrator</lastModifiedBy>
             <lastModifiedDate>15-Apr-2010</lastModifiedDate>
             <url>/cleartrial-ws/compounds/10201</url>
        </compound>
       <compound>
            ...
       </compound>
       ...
    </compoundRepresentations>

Sub-Resources: None

## 2.2 Get Compound

Obtains the representation for a specified compound.

Method: GET

URL: /cleartrial-ws/compounds/{compoundID}

Sample output in JSON:

    {
      "compound":{
         "id":10201,
         "name":"Test Compound",
         "code":"ABC-123",
         "description":"test",
         "createdBy":"administrator",
         "createdDate":"15-Apr-2010",
         "lastModifiedBy":"administrator",
         "lastModifiedDate":"15-Apr-2010",
         "url":"/cleartrial-ws/compounds/10201"
       }
    }

Sample output in XML:

    <compound>
        <id>10201</id>
        <name>Test Compound</name>
        <code>ABC-123</code>
        <description>test</description>
        <createdBy>administrator</createdBy>
        <createdDate>15-Apr-2010</createdDate>
        <lastModifiedBy>administrator</lastModifiedBy>
        <lastModifiedDate>15-Apr-2010</lastModifiedDate>
        <url>/cleartrial-ws/compounds/10201</url>
    </compound>

Sub-Resources: None

## 2.3 Add Compound

This ClearTrial Web Services API adds a new product by issuing an HTTP PUT command. The server expects a name, code, and description. If the product is created successfully, the server returns a compound representation similar to the one in Section 2.2. An attempt to create a compound with the same name or code as an existing compound causes the server to return an error message.

Method: PUT

URL: /cleartrial-ws/compounds

Sample input in JSON:

    {
      "compound":{
         "name":"Test Compound",
         "code":"ABC-123",
         "description":"test",
       }
    }

Corresponding response by server in JSON:

    {
     "compound": {
       "id": 10502,
       "name":"Test Compound",
       "code":"ABC-123",
       "description":"test",
       "createdBy":"joeuser",
       "createdDate":"03-May-2011",
       "lastModifiedBy":"joeuser",
       "lastModifiedDate":"03-May-2011",
       "url":"/cleartrial-ws/compounds/10502"
      }
    }

Sample input in XML:

    <compound>
            <name>Test Compound</name>
            <code>ABC-123</code>
            <description>test</description>
    </compound>

Corresponding response by server in XML:

    <compound>
            <id>10501</id>
            <name>Test Compound</name>
            <code>ABC-123</code>
            <description>test</description>
            <createdBy>joeuser</createdBy>
            <createdDate>03-May-2011</createdDate>
            <lastModifiedBy>joeuser</lastModifiedBy>
            <lastModifiedDate>03-May-2011</lastModifiedDate>
            <url>/cleartrial-ws/compounds/10501</url>
    </compound>

Sub-Resources: None