api
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
api [2019/09/25 16:54] – [Quote API] flack | api [2020/08/03 17:59] – [Similarity search] flack | ||
---|---|---|---|
Line 1: | Line 1: | ||
API base url: https:// | API base url: https:// | ||
- | Examples are demonstrated with [[https:// | + | Examples are demonstrated with [[https:// |
+ | |||
+ | Only the most important request/ | ||
====== Response status codes ====== | ====== Response status codes ====== | ||
Line 63: | Line 65: | ||
], | ], | ||
" | " | ||
- | " | + | " |
+ | " | ||
}, | }, | ||
{ | { | ||
Line 83: | Line 86: | ||
], | ], | ||
" | " | ||
- | " | + | " |
+ | " | ||
} | } | ||
] | ] | ||
} | } | ||
</ | </ | ||
+ | |||
+ | If you call this API endpoint as an authenticated user (=you provide a [[api# | ||
Line 229: | Line 235: | ||
Authentication is currently a token based authentication. | Authentication is currently a token based authentication. | ||
- | If you would like to access our protected API endpoints, please drop us an email at support@mcule.com and we can provide you with a token. | + | If you would like to access our protected API endpoints, please drop us an email at support@mcule.com |
Once you have a valid token you have to send it in the Authorization header: | Once you have a valid token you have to send it in the Authorization header: | ||
Line 381: | Line 387: | ||
" | " | ||
{ | { | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | }, | + | }, |
{ | { | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | }, | + | }, |
{ | { | ||
- | " | + | " |
- | " | + | " |
- | "smiles": " | + | " |
- | " | + | " |
- | }, | + | "query": " |
+ | " | ||
+ | " | ||
+ | }, | ||
{ | { | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
} | } | ||
Line 407: | Line 425: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | Please note that in case the queries are InChIKeys, **matching_level** and **matching_level_display** will always be **null** in the response. | ||
===== Multiple queries exact search with availability ===== | ===== Multiple queries exact search with availability ===== | ||
Line 447: | Line 467: | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
- | }, | + | }, |
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | }, | + | }, |
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
- | }, | + | }, |
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | }, | + | }, |
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
- | }, | + | }, |
- | " | + | " |
- | " | + | " |
- | "smiles": " | + | " |
- | " | + | " |
- | }, | + | "query": " |
+ | " | ||
+ | " | ||
+ | }, | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
- | }, | + | }, |
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
} | } | ||
] | ] | ||
- | } | + | } |
+ | </ | ||
+ | |||
+ | Please note that in case the queries are InChIKeys, **matching_level** and **matching_level_display** will always be **null** in the response. | ||
+ | |||
+ | |||
+ | ===== Similarity search ===== | ||
+ | Similarity search currently accepts the following input identifiers: | ||
+ | |||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | or | ||
+ | |||
+ | < | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | == Request: == | ||
+ | < | ||
+ | POST / | ||
+ | Accept: application/ | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | == Response: == | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: POST, OPTIONS | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The **threshold** field accepts values between 0.7 and 1.0, the default is 0.9. | ||
+ | |||
+ | The **limit** field accepts values between 1 and 1000, the default is 100. | ||
+ | |||
+ | |||
+ | ===== Substructure search ===== | ||
+ | Substructure search currently accepts the following input identifiers: | ||
+ | |||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | == Request: == | ||
+ | < | ||
+ | POST / | ||
+ | Accept: application/ | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | == Response: == | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: POST, OPTIONS | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
</ | </ | ||
+ | The **limit** field accepts values between 1 and 1000, the default is 100. | ||
Line 642: | Line 808: | ||
* **target_volume**: | * **target_volume**: | ||
* **target_cc**: | * **target_cc**: | ||
+ | * **extra_amount**: | ||
* **customer_email**: | * **customer_email**: | ||
* **delivery_time**: | * **delivery_time**: | ||
Line 1105: | Line 1272: | ||
} | } | ||
], | ], | ||
- | " | ||
" | " | ||
" | " | ||
Line 1286: | Line 1452: | ||
* **structure_origin_mcule_id**: | * **structure_origin_mcule_id**: | ||
* **quote**: The ID of the quote this product level quote data belongs to. | * **quote**: The ID of the quote this product level quote data belongs to. | ||
- | * **missing_mcule_ids**: | ||
* **name**: The name of the quote. Quotes created via the API don't have names. | * **name**: The name of the quote. Quotes created via the API don't have names. | ||
* **order_data**: | * **order_data**: | ||
Line 1321: | Line 1486: | ||
* **valid_until**: | * **valid_until**: | ||
| | ||
+ | ==== Quote - Missing structures ==== | ||
+ | |||
+ | You can get the missing structures along with the reason of their exclusion. | ||
+ | |||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | And it will return a similar response to this: | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
==== Download quote as PDF ==== | ==== Download quote as PDF ==== | ||
api.txt · Last modified: 2024/05/10 08:12 by bkovats