ultimate-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 | ||
ultimate-api [2020/07/20 13:41] – flack | ultimate-api [2021/05/25 14:21] – flack | ||
---|---|---|---|
Line 225: | Line 225: | ||
</ | </ | ||
- | In case of similarity searches the **tan** value contains the similarity value. | + | In case of similarity searches the **tan** value the response |
+ | |||
+ | In case of similarity searches you can control the minimum similarity with the **sim_threshold** param. Its default | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
Line 304: | Line 316: | ||
" | " | ||
} | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | ====== Compounds API ====== | ||
+ | |||
+ | ===== Compound details ===== | ||
+ | |||
+ | For example for the compound identified by the InChIKey **PKGBDLPHSYFAFJ-UHFFFAOYSA-N** you can get the detail response the following way: | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | |||
+ | == Request: == | ||
+ | < | ||
+ | GET / | ||
+ | </ | ||
+ | |||
+ | == Response: == | ||
+ | < | ||
+ | HTTP/1.1 200 OK Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Compounds export ===== | ||
+ | |||
+ | If you have a set of identifiers you can export the corresponding compounds into SMILES or SDF files. | ||
+ | |||
+ | ==== SDF file ==== | ||
+ | |||
+ | < | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | == Request: == | ||
+ | < | ||
+ | POST / | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | == Response: == | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Content-Type: | ||
+ | Content-Disposition: | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ==== SMILES file ==== | ||
+ | |||
+ | < | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | == Request: == | ||
+ | < | ||
+ | POST / | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | == Response: == | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Content-Type: | ||
+ | Content-Disposition: | ||
</ | </ | ||
Line 321: | Line 455: | ||
== Example API request: == | == Example API request: == | ||
< | < | ||
- | echo ' | + | echo ' |
</ | </ | ||
Line 630: | Line 764: | ||
- | ===== Quote Request API ===== | + | ====== Quote Request API ====== |
== Endpoint: == | == Endpoint: == | ||
Line 637: | Line 771: | ||
== Example API request: == | == Example API request: == | ||
< | < | ||
- | echo '{" | + | echo ' |
- | QWPFQODIGUYSLE-UHFFFAOYSA-N" | + | |
</ | </ | ||
Line 645: | Line 778: | ||
* list of InChIKeys (which you get from search results for example). For example: < | * list of InChIKeys (which you get from search results for example). For example: < | ||
* list of InChIKey, amount pairs. This is useful if you want to request quote for different amounts. For example: < | * list of InChIKey, amount pairs. This is useful if you want to request quote for different amounts. For example: < | ||
- | * **customer_name**: | + | * **customer_name**: |
- | * **customer_last_name**: | + | |
* **delivery_country**: | * **delivery_country**: | ||
Optional fields: | Optional fields: | ||
- | * **customer_email**: | + | * **customer_email**: |
- | * **amount**: Amount per molecule | + | |
* **currency**: | * **currency**: | ||
+ | * **scheme**: If you have access to predefined quote request schemes, you can specify here which one you want to use. A quote query scheme is essentially a template that contains predefined quote query parameters, or even include private parameters that affect quote generation in various ways (e.g.: discounts, predefined custom prices). These parameters can be customized for your use case. The scheme might already contain mandatory fields like delivery_country. In this case you don't have to specify them again, they will be applied from the scheme. Any explicitly specified public parameter during the request will override the one that comes from the specified scheme. | ||
Line 683: | Line 814: | ||
{ | { | ||
- | " | + | " |
- | " | + | " |
- | "created": " | + | "created_at": " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | "end_date": null, | + | " |
- | " | + | "code": " |
- | " | + | " |
- | " | + | }, |
- | "start_date": null, | + | "delivery_format": |
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
+ | "scheme": | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
} | } | ||
</ | </ | ||
+ | |||
+ | |||
+ | ====== Quote Request Status API ====== | ||
+ | |||
+ | Since processing a quote request and generating suitable quotes can take some time it is an asynchronous process. You can query the status of a quote request by calling the detail API endpoint of the quote request. It is returned in the **api_url** field when you create the quote request. You can also use the **id** field to construct the url of the API call. You can check the **state** field of the response whether the async quote request processing is finished. | ||
+ | |||
+ | States: | ||
+ | * **10 / Pending**: The quote query is queued but the processing has not started yet. | ||
+ | * **20 / Running**: The processing of the quote query is in progress. | ||
+ | * **30 / Done**: The processing of the quote query is finished. For one quote request query we might generate multiple quotes or it is also possible that we could not generate any quotes for a particular quote request. If there are quotes they will appear in the **quotes** field that contains a list of the generated quotes and some basic info about them. You can get detailed data of a particular quote by calling the endpoint specified in the **api_url** field. | ||
+ | * **40 / Error**: An error happened during the processing of the quote query. | ||
+ | |||
+ | Following the above example where the ID of the quote request is //9// we query the status of the quote request: | ||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | == Example request: === | ||
+ | |||
+ | < | ||
+ | GET / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | </ | ||
+ | |||
+ | == Example response: === | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: GET, HEAD, OPTIONS | ||
+ | Connection: keep-alive | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }</ | ||
+ | |||
+ | Check for the **quotes** field. If it is there and contains some items in the list, we could generate some quotes for your quote query. As you can see from the above result, we could generate 1 quote for the quote query. A "Best price" quote. | ||
+ | |||
+ | |||
+ | ====== Quote API ====== | ||
+ | |||
+ | In order to get the detailed data of an individual quote, you can call the detail API endpoint of a quote, for example for the quote with ID //9//: | ||
+ | |||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | == Example request: === | ||
+ | < | ||
+ | GET / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | </ | ||
+ | |||
+ | == Example response: === | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: GET, HEAD, OPTIONS | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | == Fields: === | ||
+ | * **additional_document_notes**: | ||
+ | * **avg_product_price**: | ||
+ | * **avg_product_price_currency**: | ||
+ | * **coverage_percent**: | ||
+ | * **created_at**: | ||
+ | * **id**: The ID of the Instant Quote. | ||
+ | * **items**: list of product level data | ||
+ | * **amount**: Quoted amount (mg) | ||
+ | * **compound**: | ||
+ | * **product_price**: | ||
+ | * **product_price_currency**: | ||
+ | * **purity_percent**: | ||
+ | * **payment_due_days**: | ||
+ | * **price_items**: | ||
+ | * **product_discount_price**: | ||
+ | * **product_discount_price_currency**: | ||
+ | * **products_price**: | ||
+ | * **products_price_currency**: | ||
+ | * **query**: The quote query fields | ||
+ | * **reference_id_full**: | ||
+ | * **reformatting_price**: | ||
+ | * **reformatting_price_currency**: | ||
+ | * **selection_criteria**: | ||
+ | * **selection_criteria_display**: | ||
+ | * **shipping_price**: | ||
+ | * **shipping_price_currency**: | ||
+ | * **state**: State code of the quote. | ||
+ | * **state_display**: | ||
+ | * **total_discount_price**: | ||
+ | * **total_discount_price_currency**: | ||
+ | * **total_price**: | ||
+ | * **total_price_currency**: | ||
+ | * **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:// | ||
+ | </ | ||
+ | |||
+ | |||
ultimate-api.txt · Last modified: 2021/05/25 14:27 by flack