3D structure creation using Glycam - ReneRanzinger/glycam.api.client GitHub Wiki

Glycan 3D structures

getToken - Retrieve token for authentication with web services

To access all other web service an authentication with token is required. This web services returns the required token.

Web service URL:

https://dev.glycam.org/json/getToken/

HTTP method: GET

Request: N/A

Response:

The token is return in the body of the response as plain text. Its a long alphanumeric string (e.g. qcRSMTl1tTJUMlSoyL4UpJ4y2iLb6k0KjiCCFT1gUan3U07iVzOgwToiW39YAd5P).

Errors: N/A

Submit Glycan for 3D structure generation

This web services is used for the 3D structure creation.

Web service URL:

https://dev.glycam.org/json/

HTTP method: POST

Authentication: The token needs to be set into the header

X-CSRFToken: qcRSMTl1tTJUMlSoyL4UpJ4y2iLb6k0KjiCCFT1gUan3U07iVzOgwToiW39YAd5P

At the same time the token also needs to be set a cookie:

[name: csrftoken]
[value: dRjCJoooJnIxdWAlE9XUoTAc6Ljd9lMXrGdOejfgYyVzAJ1oL7tyumsLaPyIFyTz]
[domain: dev.glycam.org]
[path: /]

Request:

Payload of the post request is a JSON with the request:

{
   "entity":{
      "type":"Sequence",
      "services":[
         {
            "Build":{
               "type":"Build3DStructure"
            }
         }
      ],
      "inputs":[
         {
            "Sequence":{
               "payload":"DGlcpNAcb1-OH"
            }
         }
      ]
   }
}

Most of the JSON is static. The entry.inputs.sequence.payload attribute contains the glycan sequence in Glycam format.

Response:

The response is a JSON string with the job ID and download URL or an error report.

{
   "entity":{
      "type":"Sequence"
   },
   "responses":[
      {
         "SequenceEvaluation":{
            "type":"Evaluate",
            "outputs":[
               {
                  "SequenceValidation":{
                     "SequenceIsValid":true
                  }
               },
               {
                  "BuildOptions":{
                     "options":[
                        {
                           "Linkages":[
                              null
                           ]
                        }
                     ]
                  }
               }
            ]
         }
      },
      {
         "Build3DStructure":{
            "payload":"8287bd12-f331-42e1-ace4-ca22583ccf5a",
            "downloadUrl":"http://dev.glycam.org/json/download/cb/8287bd12-f331-42e1-ace4-ca22583ccf5a"
         }
      }
   ]
}

The property responses.Build3DStructure.payload contains the job ID for the 3D structure generation. The property responses.Build3DStructure.downloadUrl the URL for the PDB once the generation is finished.

Errors:

N/A