In order to store user-submitted data into the GlyTouCan RDF, an authorization check is required to authenticate the registrant. Instead of using a username and password, GlyTouCan generates a specific Contributor ID and API key.The ID and key can be obtained via the profile page.
This issue (https://gitlab.com/glycosmos/glytoucan-v4group/issue/-/issues/13) was reported to us by glytoucan pertner.
If you receive this error:curl: (56) HTTP/2 stream 1 was reset
, please update your curl command to the latest version and try again. We would appreciate it if you could report the results.
For general users, registration is limited to 100 entries. To lift this restriction, obtaining an additional passcode is necessary. While this information is intended for database partners, please feel free to reach out to support if you deem it necessary.
POST API https://glytoucan.org/api/bulkload/:format
:format -> wurcs
or glycoct
curl -XPOST -F "file=@./insert.txt" -u {contributorID}:{API-KEY} https://glytoucan.org/api/bulkload/wurcs
If you have passcode, add this header:-H "GLYTOUCANBEARER: {{passcode}}"
Please use files containing only WURCS sequences and newlines.
The registration system will recognize two consecutive newlines as separators.
WURCS=2.0/...
WURCS=2.0/...
WURCS=2.0/...
....
The specification regarding this delimiter of GlycoCTis still under consideration.
We believe that there is room for discussion regarding the GlycoCT delimiter, such as the use of another character such as "####" or the replacement of line feeds with (¥n) and treatment in the same manner as WURCS. Please let me know if you have any suggestions.
Please use files containing only GlycoCT sequences and newlines.
The registration system will recognize regex of (?=RES\\n1[a-zA-Z])
as separators.
RES
1s....
...
RES
1s....
....
This API will be maintained for backwards compatibility for a while and then deprecated in the future.
POST API https://api.glytoucan.org/glycan/register
Basic Authentication over HTTPS is used to transfer the user authentication information.
How basic authentication is handled depends upon the tool being used, for curl, it is the --user
parameter.
Note: In the example below, data is sent in json. The sequence must be json encoded.
Please Note Please be carefully to escape some characters such as ‘$’or '|' that may be contained within some sequence data when using the command line scripts.
curl -X POST --header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--user <GTC Contributor ID>:<GTC API Key> \
--data '{ "sequence": "<sequence data>" }' \
'https://api.alpha.glytoucan.org/glycan/register'
If your submissions is successful, the following response should be returned.
{"timestamp":"2019-08-20T05:58:13.394+0000","status":"202","error":"","message":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","path":"/glycan/register"}