Metamolecular™
Logo
  • How It Works
  • |
  • API Documentation
  • |
  • Log In
  • |
  • Sign Up

Execution

[application/vnd.com.chemcaster.Execution+json]

An Execution represents the execution of an executable resource such as a Query. After creation, no attempt is made to store an Execution; clients must any representation immediately. An Execution has the following resources and attributes:

Name Type Occurs Description
execution:cursor String 0..1 An optional cursor, useful for pagination. [create]
execution:reverse boolean 0..1 Determines whether this Execution will scan in reverse mode. Useful for implementing previous page links. [create]
execution:maximum_results Number 0..1 Determines the maximum number of results to return when executing. [create]
execution:next_cursor String 0..1 The next cursor for this Exection. Useful for implementing next page links.
execution:previous_cursor String 0..1 The previous cursor for this Exection. Useful for implementing previous page links.
substances [[Link]] 1 A nested array of Substance Links. Each inner array item is related to its peers through a Structure. If a Registry contains only single-structure substances, each inner array will contain one matching Substance.
executable Link 1 The executable resource hosting this Execution, typically a Query.

Sample Requests and Responses

Representations are transported between client and server over HTTP using media types specific to each resource. For details, see Common Behaviors.

Note: clients MUST NOT make assumptions about the layout of the URIs within the Service.

The following examples illustrate sample requests and responses.

Create Execution

Synopsis
POST {URI of Execution Index resource}
Request Headers
Accept, Authorization, Content-Type
Request Message Body
[application/vnd.com.chemcaster.Execution+json]
Response Headers
Content-Length, Content-Type
Response Message Body
[application/vnd.com.chemcaster.Execution+json]
Response Status
200, 401, 404, 406, 422

Example Request

Post /queries/6/executions
Host: chemcaster.com
Authorization: Basic xxxxxxxxxxxxxxxxxxx
Accept: application/vnd.com.chemcaster.Execution+json
Content-Type: application/vnd.com.chemcaster.Execution+json

{
  "execution": {
    "cursor":"136",
    "reverse":true,
    "maximum_results":5
  }
}

Example Response

HTTP/1.1 200 OK
Content-Type: application/vnd.com.chemcaster.Execution+json
Content-Length: nnn

{
  "index": {
    "name": "execution index",
    "media_type": "application\/vnd.com.chemcaster.Index+json",
    "uri": "https:\/\/chemcaster.com\/queries\/6\/executions"
  },
  "substances": [
    [
      {
        "name": "substance match",
        "media_type": "application\/vnd.com.chemcaster.Substance+json",
        "uri": "https:\/\/chemcaster.com\/substances\/130"
      }
    ],
    [
      {
        "name": "substance match",
        "media_type": "application\/vnd.com.chemcaster.Substance+json",
        "uri": "https:\/\/chemcaster.com\/substances\/131"
      }
    ],
    [
      {
        "name": "substance match",
        "media_type": "application\/vnd.com.chemcaster.Substance+json",
        "uri": "https:\/\/chemcaster.com\/substances\/132"
      }
    ],
    [
      {
        "name": "substance match",
        "media_type": "application\/vnd.com.chemcaster.Substance+json",
        "uri": "https:\/\/chemcaster.com\/substances\/133"
      }
    ],
    [
      {
        "name": "substance match",
        "media_type": "application\/vnd.com.chemcaster.Substance+json",
        "uri": "https:\/\/chemcaster.com\/substances\/134"
      }
    ],
    [
      {
        "name": "substance match",
        "media_type": "application\/vnd.com.chemcaster.Substance+json",
        "uri": "https:\/\/chemcaster.com\/substances\/135"
      }
    ]
  ],
  "execution": {
    "reverse": true,
    "cursor": 136,
    "next_cursor": 135,
    "maximum_results": 5,
    "previous_cursor": 130
  },
  "executable": {
    "name": "parent query",
    "media_type": "application\/vnd.com.chemcaster.Query+json",
    "uri": "https:\/\/chemcaster.com\/queries\/6"
  }
}

This documentation is based in part on the Sun Cloud API Documentation, which was adapted under the Creative Commons Attribution 3.0 Unported License.

About Chemcaster

Chemcaster is a platform for rapidly creating websites needing chemical structure registration, imaging and search.

We're looking for developers interested in trying Chemcaster during its testing period. Sign up today for a free account!

REST API Quick Reference

  • Overview
  • Common Behaviors
  • Resources

Ruby_logo_small Php_logo_small

© 2009, 2010 Metamolecular, LLC

Terms of Service | Privacy Policy

20100702190759 - 31a55584cbb943cf3a1fc462246b2f40e03cff87