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/08/22 19:08] – flack | api [2019/09/23 11:42] – [Python code examples / Code repository] flack | ||
---|---|---|---|
Line 229: | Line 229: | ||
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 info@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 and we can provide you with a token. |
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 241: | Line 241: | ||
</ | </ | ||
+ | If you have a valid access token you can check it on the [[https:// | ||
====== Protected API endpoints ====== | ====== Protected API endpoints ====== | ||
Line 641: | Line 642: | ||
* **target_volume**: | * **target_volume**: | ||
* **target_cc**: | * **target_cc**: | ||
- | * **extra_amount**: | ||
* **customer_email**: | * **customer_email**: | ||
* **delivery_time**: | * **delivery_time**: | ||
* **purity**: Required minimum purity (%). (default: null) | * **purity**: Required minimum purity (%). (default: null) | ||
+ | * **item_filters**: | ||
+ | |||
The **amount** or target concentration-volume pair (**target_volume** and **target_cc**) need to be specified. | The **amount** or target concentration-volume pair (**target_volume** and **target_cc**) need to be specified. | ||
+ | |||
+ | **item_filters** example: | ||
+ | It has to be a data structure where keys are mcule IDs you specified in the **mcule_ids** field. If you specify a key that is not an item in the **mcule_ids** list you should get a validation error (400 Bad Request). | ||
+ | Currently only supplier filtering is supported. You can specify a supplier ID list in the **suppliers** field to restrict product selection of a given item to a list of suppliers. If the list contains only one supplier ID, you restrict the product selection to that particular supplier. To get the ID of a supplier you can use the [[api# | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
Advanced optional fields: | Advanced optional fields: | ||
Line 701: | Line 713: | ||
" | " | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 771: | Line 782: | ||
" | " | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 924: | Line 934: | ||
===== Quote API ===== | ===== Quote API ===== | ||
- | In order to get the detailed data of an individual quote, you can query the following | + | In order to get the detailed data of an individual quote, you can call the detail API endpoint |
< | < | ||
Line 951: | Line 961: | ||
" | " | ||
{ | { | ||
+ | " | ||
" | " | ||
" | " | ||
Line 963: | Line 974: | ||
}, | }, | ||
{ | { | ||
+ | " | ||
" | " | ||
" | " | ||
Line 975: | Line 987: | ||
}, | }, | ||
{ | { | ||
+ | " | ||
" | " | ||
" | " | ||
Line 1005: | Line 1018: | ||
" | " | ||
" | " | ||
- | " | + | " |
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 1019: | Line 1036: | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 1024: | Line 1043: | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 1034: | Line 1055: | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 1048: | Line 1073: | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
" | " | ||
- | " | + | " |
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 1062: | Line 1091: | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 1133: | Line 1166: | ||
" | " | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 1230: | Line 1262: | ||
* **avg_effective_price**: | * **avg_effective_price**: | ||
* **delivery_time**: | * **delivery_time**: | ||
- | * **quote**: The ID of the quote this supplier | + | * **quote**: The ID of the quote this catalog level quote data belongs to. |
* **coverage_percent**: | * **coverage_percent**: | ||
* **created**: | * **created**: | ||
Line 1251: | Line 1283: | ||
* **product_purity**: | * **product_purity**: | ||
* **structure_origin_mcule_id**: | * **structure_origin_mcule_id**: | ||
- | * **quote**: The ID of the quote this supplier | + | * **quote**: The ID of the quote this product level quote data belongs to. |
* **missing_mcule_ids**: | * **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. | ||
Line 1286: | Line 1318: | ||
* **updated**: | * **updated**: | ||
* **valid_until**: | * **valid_until**: | ||
- | + | ||
+ | ==== Download quote as PDF ==== | ||
+ | |||
+ | You can download a quote as a PDF file. Please note that the PDF file generation can take some time, the more item it contains the more time it will take to generate the file. | ||
+ | |||
+ | The HTTP response contains a // | ||
+ | |||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | ==== Download quote as Excel (.xlsx) file ==== | ||
+ | |||
+ | You can download a quote as an Excel file. Please note that the file generation can take some time, the more item it contains the more time it will take to generate the file. | ||
+ | |||
+ | The HTTP response contains a // | ||
+ | |||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ====== Code examples (Python) ====== | ||
+ | |||
+ | We created a public Git repository that contains Python code examples on how to use the Mcule API. These examples supplement the above API documentation and might give you a better understanding on how you can utilize those API endpoints currently. | ||
+ | |||
+ | The repository is available here: | ||
+ | [[https:// | ||
+ | |||
+ | We'll probably extend this repository with new examples later. |
api.txt · Last modified: 2024/05/10 08:12 by bkovats