MolConverter Resource

Expose CXN mol converter functionality for a single molecule.

GET /molconverter/convert

Convert a molecule using MolExporter#exportToFormat(chemaxon.struc.Molecule, java.lang.String). The response of this method is an object containing the converted structure and additional information.

Note that it is recommended to use POST requests with JSON (`application/json`) parameters (passed in the request body.)

Request Parameters
name type description default constraints
binary query Use binary format by invoking MolExporter#exportToBinFormat(chemaxon.struc.Molecule, java.lang.String) and base64 encoding the result false boolean
clean2d query Invoke Clean2D (Cleaner#clean(chemaxon.struc.MoleculeGraph, int)) on the imported structure false boolean
f query Format string to pass to MolExporter#exportToFormat(chemaxon.struc.Molecule, java.lang.String)    
importopts query Import options or null/empty string  
mol query Molecule to convert. Input is parsed using MolImporter#importMol(java.lang.String) when no import option specified; otherwise using MolImporter#importMol(java.lang.String, java.lang.String)    
Response Body
media type data type description
application/json ConversionResult (JSON) Conversion results

Example

Request
GET /molconverter/convert
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "src" : "...",
  "binary" : true,
  "result" : "...",
  "inputformat" : "..."
}
                
              

POST /molconverter/convert

Convert a molecule using MolExporter#exportToFormat(chemaxon.struc.Molecule, java.lang.String). The response of this method is an object containing the converted structure and additional information.

Note that it is recommended to use POST requests with JSON (`application/json`) parameters (passed in the request body.)

Request Parameters
name type description default constraints
binary form Use binary format by invoking MolExporter#exportToBinFormat(chemaxon.struc.Molecule, java.lang.String) and base64 encoding the result false boolean
clean2d form Invoke Clean2D (Cleaner#clean(chemaxon.struc.MoleculeGraph, int)) on the imported structure false boolean
f form Format string to pass to MolExporter#exportToFormat(chemaxon.struc.Molecule, java.lang.String)    
importopts form Import options or null/empty string  
mol form Molecule to convert. Input is parsed using MolImporter#importMol(java.lang.String) when no import option specified; otherwise using MolImporter#importMol(java.lang.String, java.lang.String)    
Response Body
media type data type description
application/json ConversionResult (JSON) Conversion results

Example

Request
POST /molconverter/convert
Content-Type: application/x-www-form-urlencoded
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "src" : "...",
  "binary" : true,
  "result" : "...",
  "inputformat" : "..."
}
                
              

POST /molconverter/convert

Convert a molecule using MolExporter#exportToFormat(chemaxon.struc.Molecule, java.lang.String). The response of this method is an object containing the converted structure and additional information.

Request Body
media type data type description
application/json ConversionRequest (JSON) Conversion request
Response Body
media type data type description
application/json ConversionResult (JSON) Conversion results

Example

Request
POST /molconverter/convert
Content-Type: application/json
Accept: application/json

                
{
  "mol" : "...",
  "importopts" : "...",
  "f" : "...",
  "binary" : true,
  "clean2d" : true,
  "molname" : "...",
  "molprops" : {
    "property1" : "...",
    "property2" : "..."
  },
  "pseudos" : {
    "property1" : "...",
    "property2" : "..."
  }
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "src" : "...",
  "binary" : true,
  "result" : "...",
  "inputformat" : "..."
}
                
              

POST /molconverter/convert-multiple

Invoke multiple independent conversions. Upon success the response is composed of the results of individual requests. Upon error the first request causing an error will be returned.

Request Body
media type data type description
application/json MultiConversionRequest (JSON) Multiple conversions request
Response Body
media type data type description
application/json MultiConversionResult (JSON) Conversion results

Example

Request
POST /molconverter/convert-multiple
Content-Type: application/json
Accept: application/json

                
{
  "requests" : [ {
    "mol" : "...",
    "importopts" : "...",
    "f" : "...",
    "binary" : true,
    "clean2d" : true,
    "molname" : "...",
    "molprops" : {
      "property1" : "...",
      "property2" : "..."
    },
    "pseudos" : {
      "property1" : "...",
      "property2" : "..."
    }
  }, {
    "mol" : "...",
    "importopts" : "...",
    "f" : "...",
    "binary" : true,
    "clean2d" : true,
    "molname" : "...",
    "molprops" : {
      "property1" : "...",
      "property2" : "..."
    },
    "pseudos" : {
      "property1" : "...",
      "property2" : "..."
    }
  } ]
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "results" : [ {
    "src" : "...",
    "binary" : true,
    "result" : "...",
    "inputformat" : "..."
  }, {
    "src" : "...",
    "binary" : true,
    "result" : "...",
    "inputformat" : "..."
  } ]
}
                
              

GET /molconverter/cxbinformat

Convert a molecule using MolExporter#exportToFormat(chemaxon.struc.Molecule, java.lang.String).

Request Parameters
name type description default
f query Format string to pass to MolExporter#exportToBinFormat(chemaxon.struc.Molecule, java.lang.String)  
importopts query Import options or null/empty string
mol query Molecule to convert. Input is parsed using MolImporter#importMol(java.lang.String) when no import option specified; otherwise using MolImporter#importMol(java.lang.String, java.lang.String)  
Response Body
media type data type description
application/octet-stream (custom) Converted structure

Example

Request
GET /molconverter/cxbinformat
Content-Type: */*
Accept: application/octet-stream

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/octet-stream

                
...
                
              

POST /molconverter/cxbinformat

Convert a molecule using MolExporter#exportToFormat(chemaxon.struc.Molecule, java.lang.String).

Request Parameters
name type description default
f form Format string to pass to MolExporter#exportToBinFormat(chemaxon.struc.Molecule, java.lang.String)  
importopts form Import options or null/empty string
mol form Molecule to convert. Input is parsed using MolImporter#importMol(java.lang.String) when no import option specified; otherwise using MolImporter#importMol(java.lang.String, java.lang.String)  
Response Body
media type data type description
application/octet-stream (custom) Converted structure

Example

Request
POST /molconverter/cxbinformat
Content-Type: application/x-www-form-urlencoded
Accept: application/octet-stream

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/octet-stream

                
...
                
              

GET /molconverter/cxformat

Convert a molecule using MolExporter#exportToFormat(chemaxon.struc.Molecule, java.lang.String). The response of this method is the converted structure.

Request Parameters
name type description default
f query Format string to pass to MolExporter#exportToFormat(chemaxon.struc.Molecule, java.lang.String)  
importopts query Import options or null/empty string
mol query Molecule to convert. Input is parsed using MolImporter#importMol(java.lang.String) when no import option specified; otherwise using MolImporter#importMol(java.lang.String, java.lang.String)  
Response Body
media type data type description
text/plain (custom) Converted structure

Example

Request
GET /molconverter/cxformat
Content-Type: */*
Accept: text/plain

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: text/plain

                
...
                
              

POST /molconverter/cxformat

Convert a molecule using MolExporter#exportToFormat(chemaxon.struc.Molecule, java.lang.String). The response of this method is the converted structure.

Request Parameters
name type description default
f form Format string to pass to MolExporter#exportToFormat(chemaxon.struc.Molecule, java.lang.String)  
importopts form Import options or null/empty string
mol form Molecule to convert. Input is parsed using MolImporter#importMol(java.lang.String) when no import option specified; otherwise using MolImporter#importMol(java.lang.String, java.lang.String)  
Response Body
media type data type description
text/plain (custom) Converted structure

Example

Request
POST /molconverter/cxformat
Content-Type: application/x-www-form-urlencoded
Accept: text/plain

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: text/plain

                
...