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/04 16:32] – flack | api [2020/04/08 18:57] – flack | ||
---|---|---|---|
Line 63: | Line 63: | ||
], | ], | ||
" | " | ||
- | " | + | " |
+ | " | ||
}, | }, | ||
{ | { | ||
Line 83: | Line 84: | ||
], | ], | ||
" | " | ||
- | " | + | " |
+ | " | ||
} | } | ||
] | ] | ||
} | } | ||
</ | </ | ||
+ | |||
+ | If you call this API endpoint as an authenticated user (=you provide a [[api# | ||
Line 229: | Line 233: | ||
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 642: | Line 646: | ||
* **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) | ||
+ | * **higher_amounts**: | ||
+ | * **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 1092: | Line 1110: | ||
} | } | ||
], | ], | ||
- | " | ||
" | " | ||
" | " | ||
Line 1268: | Line 1285: | ||
* **product**: | * **product**: | ||
* **product_compound_mcule_id**: | * **product_compound_mcule_id**: | ||
+ | * **product_delivery_time**: | ||
* **product_price**: | * **product_price**: | ||
* **product_purity**: | * **product_purity**: | ||
* **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 1306: | Line 1323: | ||
* **updated**: | * **updated**: | ||
* **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 ==== | ||
+ | |||
+ | 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