NAV Navbar
shell ruby javascript

Introduction

Scientist’s Application Programming Interface (API) gives application developers programmatic access to the Scientist.com marketplace platform. Developers servicing suppliers and client organizations can use the API to add value to marketplace. Some example applications are:

Included in this API is a powerful Webhooks callback mechanism allowing applictions to register callbacks to private applications whereby events occuring on the marketplace are delivered to developer applications. In this way third party applications maintain synchronicity with activities on the Scientist.com marketplace.

To use the API you first authenticate using OAuth2.

API Versions

Currently the API implements a set of Version 1 ("API V1") and Version 2 ("API V2") endpoints. The API V2 includes all the API V1 endpoints, plus additional endpoints. Unless otherwise noted in the documentation requests to either V1 or V2 endpoint will return the same response from the marketplace server.

Moving forward the API V1 will remain supported but new endpoints will be implemented in V2 and not V1. For this reason developers are highly encouraged to use the API V2 endpoints for their applications.

Location

The Scientist.com API is accessible at whatever website you use to access the marketplace.

For /api/v1 and subsequent API versions subsequent to v2 substitute v1 or other version acronym for v2 in the above examples.

Authentication

require 'oauth2'
require 'assaydepot'

site = "http://app.scientist.com"
client = OAuth2::Client.new( ENV["CLIENT_ID"], ENV["CLIENT_SECRET"], site: site)
access_token = client.client_credentials.get_token(:redirect_uri => 'http://localhost:4567/oauth2/callback')
AssayDepot.configure do |config|
  config.access_token = "#{access_token}"
  config.url = "#{site}/api/v1"
end
# Request Authorization Code
# embed the tokens in the encrypted token grant request
curl "https://CLIENT_ID:CLIENT_SECRET@app.scientist.com/oauth/token?grant_type=client_credentials"

# With shell, replace the [bearer_token] with the the token response from the grant request
curl --header "Authorization: Bearer [bearer_token]" https://app.scientist.com/api/[resource].json
const AssayDepot = require('AssayDepot');

let api = AssayDepot.authorize(CLIENT_ID, CLIENT_SECRET);

Authentication on the Scientist.com platform is a two-step process.

Create marketplace application

To authenticate an application developers first "create" the application using their Scientist.com account as follows:

  1. Log in to your Scientist account and click Dashboard
  2. Click Edit My Profile
  3. Choose the Applications tab
  4. Click New Application
  5. Fill in the fields as appropriate and click Create

Once created, click Show to obtain your CLIENT_ID and CLIENT_SECRET.

To authorize, use this code:

Make sure to replace bearer_token with your API key.

AssayDepot uses API keys to allow access to the API. You can register a new AssayDepot API key at our developer portal.

AssayDepot expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: Bearer [bearer_token]

API Reference

Overview

The API provides facilities for free-text and faceted search of the major entities stored in the marketplace. Unless otherwise noted, GET requests with no parameters to the endpoints returns the the first page of results and a facets object describing the features available for query. Developers can use the information returned by the first request to create a picklist or otherwise issue another request with more specific criteria.

Terminology

Some terminology on the marketplace is used interchangeably and can be confusing to the uninitiated. Below is a list of some of the major terms and concepts important to the marketplace API:

Categories

Suppliers of goods and services (aka "Providers") registering on the marketplace select from a list of categories to describe their offerings or "Wares". Applications can use this information to create picklists or otherwise search the marketplace for specific, relevant categories of suppliers.

All Categories

categories = AssayDepot::Cateogry.get()
curl "http://app.scientist.com/api/v2/categories.json"
  -H "Authorization: Bearer [bearer_token]"
api.category.get().then(({categories}) => {
    // do something
});

The above command returns JSON structured like this:

{
    "query_time": -0.001471,
    "category_refs": [
        {
            "name": "Drug Metabolism and Pharmacokinetics (DMPK)",
            "slug": "dmpk",
            "parent_id": null,
            "children": [
                {
                    "name": "Radioanalysis",
                    "slug": "radioanalysis",
                    "parent_id": 738,
                    "children": []
                },
                {
                    "name": "in vitro ADME",
                    "slug": "in-vitro-adme",
                    "parent_id": 738,
                    "children": [
                        {
                            "name": "Drug-Drug Interactions",
                            "slug": "drug-drug-interactions5",
                            "parent_id": 1184,
                            "children": []
                        }
                    ]
                },
                {
                    "name": "in vivo ADME",
                    "slug": "in-vivo-adme",
                    "parent_id": 738,
                    "children": [
                        {
                            "name": "Placental Transfer and Milk Secretion",
                            "slug": "placental-transfer-and-milk-secretion",
                            "parent_id": 1183,
                            "children": []
                        },
                        {
                            "name": "QWBA / Tissue Distribution",
                            "slug": "qwba-tissue-distribution",
                            "parent_id": 1183,
                            "children": []
                        },
                        {
                            "name": "Excretion, Mass Balance, and Expired Air",
                            "slug": "excretion-mass-balance-and-expired-air",
                            "parent_id": 1183,
                            "children": []
                        },
                        {
                            "name": "Surgical Models",
                            "slug": "surgical-models",
                            "parent_id": 1183,
                            "children": []
                        }
                    ]
                }
            ]
        }
    ]
}

The Category endpoint responds with a hierarchical list of available categories on the marketplace.

HTTP Request

GET http://app.scientist.com/api/v2/categories.json

A Specific Category

Categories can have multiple sub-categories. There is no physical limit to the category nesting. Each category, regardless of its place in the hierarchy has a unique slug identifier provided in the response object. Use this slug to request details for a spcific category.

You can either include the :slug in the url request /categories/:slug.json, or as an optional query string /categories.json?q=:slug.

category = AssayDepot::Category.get('radioanalysis')
curl "http://app.scientist.com/api/v2/categories/radioanalysis.json"
  -H "Authorization: Bearer [bearer_token]"
api.category.get('radioanalysis').then(({categories}) => {
    // do something
});

The above command returns JSON structured like this:

{
    "query_time": -0.000159,
    "category_refs": [
        {
            "name": "Radioanalysis",
            "slug": "radioanalysis",
            "parent_id": 738,
            "children": []
        }
    ]
}

This endpoint retrieves a the category identified by :slug.

HTTP Request

GET http://app.scientist.com/api/v2/categories/:slug.json

GET http://app.scientist.com/api/v2/categories.json?q=:slug

Providers

Providers refer to suppliers of goods and services on the marketplace. By contrast Organizations refer to client organizations who request and purchase goods and services.

Query available providers or vendors using the /providers.json endpoint. In addition to the basic get all and get specific providers, application developers can use free text or faceted search facilities to request relevant lists of providers.

All Providers

The /providers.json request responds with an object containing the first page of suppliers available at provider_refs, and a facets object keyed by the search terms available to refine subsequent provider queries.

providers = AssayDepot::Provider.get()
curl "http://app.scientist.com/api/v2/providers.json"
  -H "Authorization: Bearer [bearer_token]"
api.provider.get().then(({providers}) => {
    // do something
});

The above command returns JSON structured like this:

{
    "total": 17683,
    "page": 1,
    "per_page": 25,
    "query_time": 0.451113,
    "facets": {
        "provisional": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": 0,
                    "key_as_string": "false",
                    "doc_count": 17683
                }
            ]
        },
        "beacon_ids": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "countries_facet": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "contract_status": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "Not signed up",
                    "doc_count": 14946
                },
                {
                    "key": "Signed up",
                    "doc_count": 2655
                },
                {
                    "key": "Pending agreement",
                    "doc_count": 82
                }
            ]
        },
        "total_requests_completed": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": 0,
                    "doc_count": 16798
                },
                {
                    "key": 1,
                    "doc_count": 365
                }
            ]
        },
        "annotation_names": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "source": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "External",
                    "doc_count": 17683
                }
            ]
        },
        "certifications": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "builtin_annotations": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "This supplier has agreed to the Scientist.com Supplier Agreement",
                    "doc_count": 2655
                }
            ]
        },
        "starts_with": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "a",
                    "doc_count": 1821
                },
                {
                    "key": "u",
                    "doc_count": 1770
                }
            ]
        },
        "signed_legal_documents": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "diversity": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "states_facet": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "type_of_company_description": {
            "doc_count": 17683,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "Small Business (1-10M TTM Revenue)",
                    "doc_count": 11786
                },
                {
                    "key": "Academic Core Facility",
                    "doc_count": 3895
                },
                {
                    "key": "New Startup (0-1M TTM Revenue)",
                    "doc_count": 1207
                },
                {
                    "key": "Mid-Sized Business (10-100M TTM Revenue)",
                    "doc_count": 583
                },
                {
                    "key": "Large Business (>100M TTM Revenue)",
                    "doc_count": 109
                },
                {
                    "key": "Consultant",
                    "doc_count": 49
                }
            ]
        }
    },
    "provider_refs": [
        {
            "id": 2074,
            "uuid": "25e443c4-8a04-4967-bb91-d3887f6f4cfd",
            "slug": "takii-company-ltd",
            "name": "Takii & Company Ltd.",
            "snippet_plain": "Takii was established ....",
            "snippet": "Takii was established in 1835, starting as a seed store, ....",
            "html_snippet": "<p>Takii was established in 1835, starting as a seed store, ...</p>",
            "description": null,
            "html_description": "",
            "average_rating": 0,
            "permission": "database-only",
            "locations": [],
            "urls": {
                "storefront": "https://app.scientist.com/wares/make-a-request/quote_groups/new?provider=Takii+&+Company+Ltd.&name=Takii+&+Company+Ltd.",
                "backoffice": "https://backoffice-staging.scientist.com/providers/takii-company-ltd/edit"
            },
            "score": 0.0
        }
    ]
}

This endpoint retrieves all providers.

HTTP Request

GET http://app.scientist.com/api/v2/providers.json

Query Parameters

Parameter Default Description
page 1 When there are more results than can fit on a single page, you can retrieve different pages by changing this parameter.
per_page 25 You can change the number of results returned per request by changing this parameter.
sort_by nil (relevance) You can change the order in which results are returned. This orders the entire result set, not just the current page.
sort_order 1 Change the direction of the result set.
facets nil You can refine the result set by specifying facet values. See Providers Faceted Search for more information.

A Specific Provider

Each provider is indexed uniquely by the id or slug found in the response object. Use the id or slug to request details for a spcific provider. The server responds with a provider object keyed by provider.

provider = AssayDepot::Provider.get('takii-company-ltd')
curl "http://app.scientist.com/api/v2/providers/takii-company-ltd.json"
  -H "Authorization: Bearer [bearer_token]"
api.provider.get('takii-company-ltd').then(({providers}) => {
    // do something
});

The above command returns JSON structured like this:

{
    "query_time": 0.009415,
    "provider": {
        "id": 2074,
        "name": "Takii & Company Ltd.",
        "official_name": null,
        "slug": "takii-company-ltd",
        "for_origin": null,
        "description": null,
        "snippet": "Takii was established in 1835, starting as a seed store, ...",
        "agreed_to_vendor_terms_at": null,
        "contract_pending": null,
        "phone_number": "81-(0)75-365-0123",
        "contact_emails": [
            "unregistered@assaydepot.com"
        ],
        "sales_email": "",
        "accounting_email": "",
        "tax_id": null,
        "duns_number": null,
        "website": "http://www.takiiseed.com/",
        "year_established": "1835",
        "number_of_employees": "",
        "type_of_company": "new-startup",
        "core_facility": false,
        "plan": null,
        "commissions": {
            "acme": ""
        },
        "permissions": {
            "acme": "none"
        },
        "provisional": false,
        "protect_profile": false,
        "top_rated": null,
        "payment_terms": {},
        "backoffice_setup": [
            "Create Account",
            "Agree to Terms"
        ],
        "certifications": [],
        "professional_associations": [
            ""
        ],
        "service_areas": [],
        "laboratories": [],
        "redirects": [],
        "cached_representative_gsls": [],
        "cached_representative_gsls_updated_at": null,
        "logo_filename": null,
        "media": [],
        "removed_files": [],
        "small_biz": false,
        "veteran_owned": false,
        "disadvantaged": false,
        "woman_owned": false,
        "disadvantaged_woman_owned": false,
        "hub_zone": false,
        "none_diversity": false,
        "total_requests": 0,
        "total_requests_completed": 0,
        "cxml_order_routing": false,
        "cxml_order_routing_url": null,
        "cxml_order_domain_type": null,
        "cxml_order_identity": null,
        "headquarters_address_id": 295285,
        "gsl_selection_id": null,
        "created_at": "2015-07-28T12:51:28.000Z",
        "updated_at": "2019-06-18T03:39:15.156Z",
        "uuid": "25e443c4-8a04-4967-bb91-d3887f6f4cfd",
        "couch_id": "176e454f72fa9fdc568821d5559f896b",
        "origin": "central",
        "access": [],
        "rxs_with_annotations": [
            "default"
        ],
        "score": 0.0,
        "tier": null,
        "snippet_plain": "Takii was established in 1835, starting as a seed store, ...",
        "builtin_annotations": []
    }
}

HTTP Request

GET http://app.scientist.com/api/v2/providers/:slug.json

GET http://app.scientist.com/api/v2/providers/:id.json

Query Parameters

Refer to Query Parameters

Providers Query

Free text searches of provider records can be used to generate lists of relevant providers.

# return an Accessor object
providers = AssayDepot::Provider.find("antibody")
providers.total
=> 45
providers = AssayDepot::Provider.find("")
providers.total
=> 17683
AssayDepot::Provider.ref_name
=> "provider_refs"

# return a JSON object
providers = AssayDepot::Provider.get("q" => "antibody")
providers["total"]
=> 45
curl "http://app.scientist.com/api/v2/provider.json?q=antibody"
  -H "Authorization: Bearer [bearer_token]"
api.provider.get({q:"antibody"}).then(({providers}) => {
    console.log(providers.total);
    // 45
});

The above command returns JSON structured like this:

{
    "total": 45,
    "page": 1,
    "per_page": 25,
    "query_time": 0.045336,
    "provider_refs": [
        {
            "id": 9734,
            "uuid": "1f44420f-6b98-47ba-89e5-bcb91cd7d7cf",
            "slug": "atlas-antibodies",
            "name": "Atlas Antibodies",
            "snippet_plain": "Atlas Antibodies handles the production, marketing and sales of the antibody products developed and validated in the Human Protein Atlas (HPA) project.",
            "snippet": "Atlas Antibodies handles the production, marketing and sales of the antibody products developed and validated in the Human Protein Atlas (HPA) project.",
            "html_snippet": "<p>Atlas Antibodies handles the production, marketing and sales of the antibody products developed and validated in the Human Protein Atlas (HPA) project.</p>",
            "description": "Atlas Antibodies handles the production, marketing and sales of the antibody products developed and validated in the Human Protein Atlas (HPA) project.",
            "html_description": "<p>Atlas Antibodies handles the production, marketing and sales of the antibody products developed and validated in the Human Protein Atlas (HPA) project.</p>",
            "average_rating": 0,
            "permission": "in-network",
            "locations": [],
            "urls": {
                "storefront": "https://app.scientist.com/wares/make-a-request/quote_groups/new?provider=Atlas+Antibodies&name=Atlas+Antibodies",
                "backoffice": "https://backoffice-staging.scientist.com/providers/atlas-antibodies/edit"
            },
            "score": 24.83889602
        },
        ...
    ],
    "facets": {
        "provisional": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": 0,
                    "key_as_string": "false",
                    "doc_count": 45
                }
            ]
        },
        "beacon_ids": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "countries_facet": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "contract_status": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "Not signed up",
                    "doc_count": 29
                },
                {
                    "key": "Signed up",
                    "doc_count": 16
                }
            ]
        },
        "total_requests_completed": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": 0,
                    "doc_count": 39
                },
                {
                    "key": 1,
                    "doc_count": 3
                },
                {
                    "key": 5,
                    "doc_count": 1
                },
                {
                    "key": 12,
                    "doc_count": 1
                },
                {
                    "key": 17,
                    "doc_count": 1
                }
            ]
        },
        "annotation_names": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "source": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "External",
                    "doc_count": 45
                }
            ]
        },
        "certifications": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "builtin_annotations": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "This supplier has agreed to the Scientist.com Supplier Agreement",
                    "doc_count": 16
                }
            ]
        },
        "starts_with": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "a",
                    "doc_count": 13
                },
                {
                    "key": "u",
                    "doc_count": 9
                },
                {
                    "key": "b",
                    "doc_count": 3
                },
                {
                    "key": "i",
                    "doc_count": 3
                },
                {
                    "key": "m",
                    "doc_count": 3
                },
                {
                    "key": "d",
                    "doc_count": 2
                },
                {
                    "key": "f",
                    "doc_count": 2
                },
                {
                    "key": "o",
                    "doc_count": 2
                },
                {
                    "key": "p",
                    "doc_count": 2
                },
                {
                    "key": "s",
                    "doc_count": 2
                },
                {
                    "key": "c",
                    "doc_count": 1
                },
                {
                    "key": "g",
                    "doc_count": 1
                },
                {
                    "key": "v",
                    "doc_count": 1
                },
                {
                    "key": "y",
                    "doc_count": 1
                }
            ]
        },
        "signed_legal_documents": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "diversity": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "states_facet": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "type_of_company_description": {
            "doc_count": 45,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "Small Business (1-10M TTM Revenue)",
                    "doc_count": 22
                },
                {
                    "key": "Academic Core Facility",
                    "doc_count": 17
                },
                {
                    "key": "New Startup (0-1M TTM Revenue)",
                    "doc_count": 3
                },
                {
                    "key": "Mid-Sized Business (10-100M TTM Revenue)",
                    "doc_count": 2
                }
            ]
        }
    }
}

HTTP Request

GET http://app.scientist.com/api/v2/providers.json?q=search_term

Query Parameters

Refer to Query Parameters

Vendor search results can be refined using facets. Facet searching requires the requestor to supply a query string of the form ?facets[facet_name][]=facet_value where facet_name is a valid facet name and facet_value is valid facet value.

# return an accessor object
providers = AssayDepot::Provider.where(:source => "External")
providers.total
=> 110

curl "http://app.scientist.com/api/v2/provider.json?facets[source][]=External"
  -H "Authorization: Bearer [bearer_token]"
api.provider.find({source: "External"}).then(({providers}) => {
    // do something
});

Search by Facet

For instance, if you wanted find external vendors, you would use the following query string:

?facets[source][]=External

The above command returns JSON structured like this:

{
    "total": 110,
    "page": 1,
    "per_page": 25,
    "query_time": 0.027559,
    "facets": {
        "provisional": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": 0,
                    "key_as_string": "false",
                    "doc_count": 110
                }
            ]
        },
        "beacon_ids": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "countries_facet": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "contract_status": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "Signed up",
                    "doc_count": 64
                },
                {
                    "key": "Not signed up",
                    "doc_count": 45
                },
                {
                    "key": "Pending agreement",
                    "doc_count": 1
                }
            ]
        },
        "total_requests_completed": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": 0,
                    "doc_count": 83
                },
                {
                    "key": 1,
                    "doc_count": 11
                }
            ]
        },
        "annotation_names": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "source": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "External",
                    "doc_count": 110
                }
            ]
        },
        "certifications": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "builtin_annotations": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "This supplier has agreed to the Scientist.com Supplier Agreement",
                    "doc_count": 64
                }
            ]
        },
        "starts_with": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "a",
                    "doc_count": 19
                },
                {
                    "key": "c",
                    "doc_count": 14
                },
                ...
            ]
        },
        "signed_legal_documents": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "diversity": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "states_facet": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "type_of_company_description": {
            "doc_count": 110,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "Small Business (1-10M TTM Revenue)",
                    "doc_count": 84
                },
                {
                    "key": "Mid-Sized Business (10-100M TTM Revenue)",
                    "doc_count": 15
                },
                {
                    "key": "New Startup (0-1M TTM Revenue)",
                    "doc_count": 8
                },
                {
                    "key": "Large Business (>100M TTM Revenue)",
                    "doc_count": 3
                }
            ]
        }
    },
    "provider_refs": [
        {
            "id": 2131,
            "uuid": "28486011-deff-4440-be9e-48ad222471ec",
            "slug": "abbiotec",
            "name": "Abbiotec",
            "snippet_plain": "Abbiotec offers peptide synthesis, polyclonal and monoclonal antibody production services as well as unique products for cell biology research.",
            "snippet": "Abbiotec offers peptide synthesis, polyclonal and monoclonal antibody production services as well as unique products for cell biology research.",
            "html_snippet": "<p>Abbiotec offers peptide synthesis, polyclonal and monoclonal antibody production services as well as unique products for cell biology research.</p>",
            "description": "!https://backoffice.assaydepot.com/files/depot-wares/18d0e278710a03c232cb813aa5033bdd/Abbiotec_Logo.png(Abbiotec)!:http://www.abbiotec.com\r\n\r\nAs researchers are focusing their efforts on determining the biological functions, interactions and regulation of the human proteome, Abbiotec is dedicated to developing cell biology-based research tools that assist scientific discoveries. Besides custom services for peptides and antibodies, Abbiotec offers over 12,000 antibodies, proteins, peptides, lysates and kits to assist researchers in understanding human biology and diseases at the cellular and molecular levels.\r\n\r\n+*Downloads*+\r\n\"Polyclonal Antibody Production Services Brochure\":https://backoffice.assaydepot.com/files/depot-wares/18d0e278710a03c232cb813aa5033bdd/Polyclonal_Antibody_Production_Services.pdf",
            "html_description": "<p><a href=\"http://www.abbiotec.com\"><img src=\"https://backoffice.assaydepot.com/files/depot-wares/18d0e278710a03c232cb813aa5033bdd/Abbiotec_Logo.png\" title=\"Abbiotec\" alt=\"Abbiotec\" /></a></p>\n<p>As researchers are focusing their efforts on determining the biological functions, interactions and regulation of the human proteome, Abbiotec is dedicated to developing cell biology-based research tools that assist scientific discoveries. Besides custom services for peptides and antibodies, Abbiotec offers over 12,000 antibodies, proteins, peptides, lysates and kits to assist researchers in understanding human biology and diseases at the cellular and molecular levels.</p>\n<p><ins><strong>Downloads</strong></ins><br />\n<a href=\"https://backoffice.assaydepot.com/files/depot-wares/18d0e278710a03c232cb813aa5033bdd/Polyclonal_Antibody_Production_Services.pdf\">Polyclonal Antibody Production Services Brochure</a></p>",
            "average_rating": 0,
            "permission": "in-network",
            "locations": [],
            "urls": {
                "storefront": "https://app.scientist.com/wares/make-a-request/quote_groups/new?provider=Abbiotec&name=Abbiotec",
                "backoffice": "https://backoffice-staging.scientist.com/providers/abbiotec/edit"
            },
            "score": 69.61915459
        }
    ]
}
# multiple facets
providers = AssayDepot::Provider.where(:starts_with => "a").where(:starts_with => "u")
providers.search_results

Use Multiple Facets

Requests can include multiple name/value pairs, for example

?facets[starts_with][]=a&facets[starts_with][]=u

returns all providers whose names start with "a" or "u".

Provider Search Facets

Unlike the query string, facet names and facet values must match exactly. Fortunately, the API provides detailed access to facets in its response object(s). For details on available facet names and values see Provider Facets.

Query Parameters

Refer to Query Parameters

The above command returns JSON structured like this:

{
    "total": 14946,
    "page": 1,
    "per_page": 25,
    "query_time": 0.045762,
    "facets": {
        "provisional": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": 0,
                    "key_as_string": "false",
                    "doc_count": 14946
                }
            ]
        },
        "beacon_ids": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "countries_facet": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "contract_status": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "Not signed up",
                    "doc_count": 14946
                }
            ]
        },
        "total_requests_completed": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": 0,
                    "doc_count": 14943
                },
                {
                    "key": 1,
                    "doc_count": 3
                }
            ]
        },
        "annotation_names": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "source": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "External",
                    "doc_count": 14946
                }
            ]
        },
        "certifications": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "builtin_annotations": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "starts_with": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "u",
                    "doc_count": 1709
                },
                {
                    "key": "a",
                    "doc_count": 1499
                },
                ...
            ]
        },
        "signed_legal_documents": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "diversity": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "states_facet": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "type_of_company_description": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "Small Business (1-10M TTM Revenue)",
                    "doc_count": 10025
                },
                {
                    "key": "Academic Core Facility",
                    "doc_count": 3806
                },
                {
                    "key": "New Startup (0-1M TTM Revenue)",
                    "doc_count": 804
                },
                {
                    "key": "Mid-Sized Business (10-100M TTM Revenue)",
                    "doc_count": 242
                },
                {
                    "key": "Large Business (>100M TTM Revenue)",
                    "doc_count": 29
                },
                {
                    "key": "Consultant",
                    "doc_count": 17
                }
            ]
        }
    },
    "provider_refs": [
        {
            "id": 2074,
            "uuid": "25e443c4-8a04-4967-bb91-d3887f6f4cfd",
            "slug": "April-ltd",
            "name": "April Ltd.",
            "snippet_plain": "April Ltd. was started in 1985 with the goal...",
            "snippet": "<p>April Ltd. was started in 1985 with the goal...</p>",
            "description": null,
            "html_description": "",
            "average_rating": 0,
            "permission": "database-only",
            "locations": [],
            "urls": {
                "storefront": "https://app.scientist.com/wares/make-a-request/quote_groups/new?provider=April+Ltd.&name=April+Ltd.",
                "backoffice": "https://backoffice-staging.scientist.com/providers/april-ltd/edit"
            },
            "score": 0.0
        },
        ...
    ]
}

Provider Facets

The response object for all providers requests includes an object keyed by facets. The keys for this object are the available facet names you can use to construct further queries to refine your results. Each facet key provides an object with information about the facet in the database.

The buckets property value holds an array of objects with valid facet_value strings provided in the key field. Use this string as the value argument to your faceted search queries.

A snippet of the "facets" object returned from a providers search request:

{"facets": {
    "starts_with": {
        "doc_count": 17683,
        "doc_count_error_upper_bound": 0,
        "sum_other_doc_count": 0,
        "buckets": [
            {
                "key": "a",
                "doc_count": 1821
            },
            {
                "key": "u",
                "doc_count": 1770
            }
        ]
    },
    "type_of_company_description": {
        "doc_count": 17683,
        "doc_count_error_upper_bound": 0,
        "sum_other_doc_count": 0,
        "buckets": [
            {
                "key": "Small Business (1-10M TTM Revenue)",
                "doc_count": 11786
            },
            {
                "key": "Academic Core Facility",
                "doc_count": 3895
            },
            {
                "key": "New Startup (0-1M TTM Revenue)",
                "doc_count": 1207
            },
            {
                "key": "Mid-Sized Business (10-100M TTM Revenue)",
                "doc_count": 583
            },
            {
                "key": "Large Business (>100M TTM Revenue)",
                "doc_count": 109
            },
            {
                "key": "Consultant",
                "doc_count": 49
            }
        ]
    }
}}

Not all facets are available for filtering. The supported facets are:

Facet Name Sample Values Notes
source
  • Internal
  • External
Narrow the results to only internal or external vendors.
starts_with
  • a
  • bio
  • clinical
  • ...
Narrow the results to vendors whose names start with the specified string.

Provider RFI Annotations

Provider RFI Annotations endpoint provides a convenient way to download RFI annotation badges for suppliers associated to your organization. Responses are available in .json or .csv.

curl "http://app.scientist.com/api/v2/provider_rfi_annotations.json"
  -H "Authorization: Bearer [bearer_token]"


The above command returns JSON structured like this:

{
    "query_time": 0.006530785,
    "results": [
        {
            "supplier": "Advanced Technology Group",
            "site": null,
            "evaluation_type": "HBS",
            "status": "Evaluated With Conditions",
            "evaluated_at": "2020-05-16T12:27:56.113+02:00",
            "evaluated_by": "Some Name (some.name@company.com)",
            "comment": "",
            "internal_comment": ""
        },
        {
            "supplier": "Research Hospital - The Mice Laboratory",
            "site": null,
            "evaluation_type": "HBS",
            "status": "Evaluated With Conditions With Direct Contract",
            "evaluated_at": "2021-02-24T12:16:26.085+01:00",
            "evaluated_by": "SomeOther Name (someother.name@company.com)",
            "comment": "Orders for human samples should be placed internally.",
            "internal_comment": ""
        },
        ...
    ]
}

This endpoint retrieves all provider RFI annotations. Specify .csv suffix to return a Comma Separated Text file or .json for a standard JSON response object.

HTTP Request

GET http://app.scientist.com/api/v2/provider_rfi_annotations.json

Or,

GET http://app.scientist.com/api/v2/provider_rfi_annotations.csv

Wares

Goods and services available from Providers on the marketplace are referred to as Wares. Use the /wares.json endpoint to develop picklists of available services, identify search terms available for querying wares and get detailed information about a specific ware.

All Wares

The get request responds with an object containing the first page of wares keyed buy the property ware_refs, and an object keyed by facets containing the search terms available to refine subsequent wares queries.

providers = AssayDepot::Ware.get()
curl "http://app.scientist.com/api/v2/wares.json"
  -H "Authorization: Bearer [bearer_token]"
api.ware.get().then(({ware}) => {
    // do something
});

The above command returns JSON structured like this:

{
    "total": 3479,
    "page": 1,
    "per_page": 25,
    "query_time": 1.076298,
    "facets": {
        "cell_source": {},
        "clonality": {},
        "protein_type": {},
        "species": {},
        "tissue": {},
        "technology": {},
        "countries": {},
        "source": {
            "central": 3479
        },
        "certifications": {},
        "ware_type": {
            "CustomService": 3472,
            "Consultant": 5,
            "Punchout": 1,
            "Service": 1
        }
    },
    "ware_refs": [
        {
            "id": 2291,
            "slug": "n-product-fermentation",
            "name": "Natural Product Fermentation",
            "price": 0.0,
            "type": "CustomService",
            "turn_around_time": null,
            "snippet": "Produce large amounts of natural products.",
            "html_snippet": "<p>Produce large amounts of natural products.</p>",
            "providers": [],
            "urls": {
                "storefront": "https://app.scientist.com/wares/n-product-fermentation/quote_groups/new",
                "backoffice": "https://backoffice-staging.scientist.com/wares/n-product-fermentation/edit"
            }
        },
        ...
    ]
}

This endpoint retrieves all wares, one page at a time.

HTTP Request

GET http://app.scientist.com/api/v2/wares.json

Query Parameters

Parameter Default Description
page 1 When there are more results than can fit on a single page, you can retrieve different pages by changing this parameter.
per_page 25 You can change the number of results returned per request by changing this parameter.
sort_by nil (relevance) You can change the order in which results are returned. This orders the entire result set, not just the current page.
sort_order 1 Change the direction of the result set.
facets nil You can refine the result set by specifying facet values. See Wares Faceted Search for more information.

A Specific Ware

Each ware is indexed uniquely by the id found in the response object. Use the id to request details for a specific ware. The server responds with a ware object keyed by ware.

ware = AssayDepot::Ware.get( 2291 )
ware["ware"]["id"]
=> 2291
curl "http://app.scientist.com/api/v2/wares/2291.json"
  -H "Authorization: Bearer [bearer_token]"
api.ware.get( 2291 ).then(({ware}) => {
    console.log(ware.id)
    // => 2291
});

The above command returns JSON structured like this:

{
    "query_time": 0.00598,
    "ware": {
        "id": 2291,
        "slug": "n-product-fermentation",
        "name": "Natural Product Fermentation",
        "price": 0,
        "turn_around_time": null,
        "type": "CustomService",
        "snippet": "Produce large amounts of natural products.",
        "description": null,
        "html_description": null,
        "keywords": [],
        "promo_description": "",
        "contact_emails": [],
        "responsible_emails": [],
        "first_published_at": null,
        "amount": null,
        "cas_number": null,
        "unspsc": "",
        "supplier_part_id": "",
        "created_at": "2009-10-07T00:26:34.000Z",
        "updated_at": "2019-05-25T08:21:34.408Z",
        "urls": {
            "storefront": "https://app.scientist.com/wares/n-product-fermentation/quote_groups/new",
            "backoffice": "https://backoffice-staging.scientist.com/wares/n-product-fermentation/edit"
        }
    }
}

HTTP Request

GET http://app.scientist.com/api/v2/wares/:id.json

Query Parameters

Refer to Query Parameters

Wares Query

The API allows you to search wares by query string such as ?q=search_term. When requested, the system will search for the search_term or it’s synonyms in all applicable service fields.

For example, the term ?q=peptide returns all services relating to peptides. Specify multiple query string values by separating search terms by commas, as in:

?q=peptide,antibody

In this example the results will be the intersection of wares relevant to both peptides and antibodies.

# return an Accessor object
ware = AssayDepot::Ware.find("antibody")
providers.total
=> 62
AssayDepot::Ware.ref_name
=> "ware_refs"

# return a JSON object
ware = AssayDepot::Ware.get()
ware["total"]
=> 3479
curl "http://app.scientist.com/api/v2/ware.json?q=antibody"
  -H "Authorization: Bearer [bearer_token]"
api.ware.get({q:"antibody"}).then(({ware}) => {
    console.log(ware.total);
    // 3479
});

The above command returns JSON structured like this:

{
    "total": 3479,
    "page": 1,
    "per_page": 25,
    "query_time": 0.578524,
    "facets": {
        "cell_source": {},
        "clonality": {},
        "protein_type": {},
        "species": {},
        "tissue": {},
        "technology": {},
        "countries": {},
        "source": {
            "central": 3479
        },
        "certifications": {},
        "ware_type": {
            "CustomService": 3472,
            "Consultant": 5,
            "Punchout": 1,
            "Service": 1
        }
    },
    "ware_refs": [
        {
            "id": 2291,
            "slug": "n-product-fermentation",
            "name": "Natural Product Fermentation",
            "price": 0.0,
            "type": "CustomService",
            "turn_around_time": null,
            "snippet": "Produce large amounts of natural products.",
            "html_snippet": "<p>Produce large amounts of natural products.</p>",
            "providers": [],
            "urls": {
                "storefront": "https://app.scientist.com/wares/n-product-fermentation/quote_groups/new",
                "backoffice": "https://backoffice-staging.scientist.com/wares/n-product-fermentation/edit"
            }
        },
        ...
    ]
}

HTTP Request

GET http://app.scientist.com/api/v2/wares.json?q=search_term

Query Parameters

Refer to Query Parameters

Ware search results can be refined using facets. Facet searching requires the requestor to supply a query string of the form ?facets[facet_name][]=facet_value where facet_name is a valid facet name and facet_value is valid facet value.

# return an accessor object
ware = AssayDepot::Ware.where(:ware_type => "CustomService")
ware.total
=> 3472

curl "http://app.scientist.com/api/v2/wares.json?facets[ware_type][]=CustomService"
  -H "Authorization: Bearer [bearer_token]"
api.ware.find({ware_type: "CustomService"}).then(({wares}) => {
    console.log(wares.total)
    // 3472
});

Search by Facet

For instance, if you wanted find wares of type CustomService, you would use the following query string:

?facets[ware_type][]=CustomService

The above command returns JSON structured like this:

{
    "total": 3472,
    "page": 1,
    "per_page": 25,
    "query_time": 0.991814,
    "facets": {
        "cell_source": {},
        "clonality": {},
        "protein_type": {},
        "species": {},
        "tissue": {},
        "technology": {},
        "countries": {},
        "source": {
            "central": 3472
        },
        "certifications": {},
        "ware_type": {
            "CustomService": 3472
        }
    },
    "ware_refs": [
        {
            "id": 2291,
            "slug": "n-product-fermentation",
            "name": "Natural Product Fermentation",
            "price": 0.0,
            "type": "CustomService",
            "turn_around_time": null,
            "snippet": "Produce large amounts of natural products.",
            "html_snippet": "<p>Produce large amounts of natural products.</p>",
            "providers": [],
            "urls": {
                "storefront": "https://app.scientist.com/wares/n-product-fermentation/quote_groups/new",
                "backoffice": "https://backoffice-staging.scientist.com/wares/n-product-fermentation/edit"
            }
        },
        ...
    ]
}
# multiple facets
providers = AssayDepot::Provider.where(:contract_status => "Not signed up").where(:source => "External")
providers.search_results

Use Multiple Facets

Requests can include multiple name/value pairs, for example

?facets[ware_type][]=Consultant&facets[source][]=central

returns all wares whose type is "Consultant" and whose source is "central".

Ware Search Facets

Unlike the query string, facet names and facet values must match exactly. Fortunately, the API provides detailed access to facets in its response object(s). For details on available facet names and values see Ware Facets.

Query Parameters

Refer to Query Parameters

The above command returns JSON structured like this:

{
    "total": 14946,
    "page": 1,
    "per_page": 25,
    "query_time": 0.045762,
    "facets": {
        "provisional": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": 0,
                    "key_as_string": "false",
                    "doc_count": 14946
                }
            ]
        },
        "beacon_ids": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "countries_facet": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "contract_status": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "Not signed up",
                    "doc_count": 14946
                }
            ]
        },
        "total_requests_completed": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": 0,
                    "doc_count": 14943
                },
                {
                    "key": 1,
                    "doc_count": 3
                }
            ]
        },
        "annotation_names": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "source": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "External",
                    "doc_count": 14946
                }
            ]
        },
        "certifications": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "builtin_annotations": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "starts_with": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "u",
                    "doc_count": 1709
                },
                {
                    "key": "a",
                    "doc_count": 1499
                },
                ...
            ]
        },
        "signed_legal_documents": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "diversity": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "states_facet": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
        },
        "type_of_company_description": {
            "doc_count": 14946,
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
                {
                    "key": "Small Business (1-10M TTM Revenue)",
                    "doc_count": 10025
                },
                {
                    "key": "Academic Core Facility",
                    "doc_count": 3806
                },
                {
                    "key": "New Startup (0-1M TTM Revenue)",
                    "doc_count": 804
                },
                {
                    "key": "Mid-Sized Business (10-100M TTM Revenue)",
                    "doc_count": 242
                },
                {
                    "key": "Large Business (>100M TTM Revenue)",
                    "doc_count": 29
                },
                {
                    "key": "Consultant",
                    "doc_count": 17
                }
            ]
        }
    },
    "provider_refs": [
        {
            "id": 2074,
            "uuid": "25e443c4-8a04-4967-bb91-d3887f6f4cfd",
            "slug": "takii-company-ltd",
            "name": "Takii & Company Ltd.",
            "snippet_plain": "Takii was established in 1835, starting as a seed store, dealing ...",
            "snippet": "Takii was established in 1835, starting as a seed store, dealing seeds of local Kyoto vegetable. Mr. Jisaburo Takii who was known as a hardworking and reliable ...</p>",
            "description": null,
            "html_description": "",
            "average_rating": 0,
            "permission": "database-only",
            "locations": [],
            "urls": {
                "storefront": "https://app.scientist.com/wares/make-a-request/quote_groups/new?provider=Takii+&+Company+Ltd.&name=Takii+&+Company+Ltd.",
                "backoffice": "https://backoffice-staging.scientist.com/providers/takii-company-ltd/edit"
            },
            "score": 0.0
        },
        ...
    ]
}

Ware Facets

The response object for all wares requests includes an object keyed by facets. The keys for this object are the available facet names you can use to construct further queries to refine your results. Each facet key provides an object of key/values where the key is the associated value and the value is a count of the number of times the facet is found in the database.

Use key string as the value argument to your faceted search queries.

A snippet of the "facets" object returned from a wares search request:

{"facets": {
    "cell_source": {},
    "clonality": {},
    "protein_type": {},
    "species": {},
    "tissue": {},
    "technology": {},
    "countries": {},
    "source": {
        "central": 3479
    },
    "certifications": {},
    "ware_type": {
        "CustomService": 3472,
        "Consultant": 5,
        "Punchout": 1,
        "Service": 1
    }
}}

Below is a table of a few interesting facets.

Facet Name Sample Values Notes
protein_type
  • Enzymes
  • Bacterial and Viral Antigens
  • Growth Factors
  • ...
Narrow the results to only services listing a specific type of protein.
species
  • Human
  • Treponema pallidum
  • Dengue virus
  • ...
Narrow the results to only services associated with a certain species.
ware_type
  • CustomService
  • Consultant
  • Punchout
  • ...
Narrow the results to only services of a particular type.

Wares-Providers

The marketplace platform allows for many-to-many relationships between service offerings (Wares) and suppliers of goods and services (Providers). The wares-providers endpoint allows API users to query providers associated with specific wares, and wares associated to specific providers.

API users with proper credentials can create and remove ware-provider associations using the POST and DELETE verbs for this endpoint.

Create Ware-Provider Association

Create associations between specific :ware_id and :provider_id by POSTing to the /ware/:ware_id/provider/:provider_id endpoint.

# WareProvider.post takes :ware_id and :provider_id as its arguments
response = AssayDepot::WareProvider.post( 2291, 2074 )
response["result"] 
=> "OK"
curl -X POST "http://app.scientist.com/api/v2/wares/2291/providers/2074.json"
  -H "Authorization: Bearer [bearer_token]"
api.ware_provider.post( 2291, 2074 ).then(({response}) => {
    console.log(response.result)
    // "OK"
});

The above command returns JSON structured like this:

{"result": "OK"}

Duplicate associations result in the following response:

{
    "message": "Provider is already published.",
    "code": "unprocessable_entity"
}

If you POST an association more than 1 time, the server will respond without changing the association.

HTTP Request

POST http://app.scientist.com/api/v2/ware/:ware_id/provider/:provider_id.json

Ware Associated Providers

Return an object containing all providers for a specific ware identifier.

ware = AssayDepot::WareProvider.get( 2291 )
curl "http://app.scientist.com/api/v2/wares/2291/providers.json"
  -H "Authorization: Bearer [bearer_token]"
api.ware_provider.get( 2291 ).then(({ware}) => {
    // do something...
});

HTTP Request

GET http://app.scientist.com/api/v2/wares/:ware_id/providers.json

The wares-providers command returns JSON structured like this:

{
    "total": 1,
    "query_time": 0.107114,
    "provider_refs": [
        {
            "id": null,
            "reference_of_type": "Pg::Provider",
            "reference_of_id": 2074,
            "reference_to_id": null,
            "uuid": null,
            "origin": "central",
            "access": [
                "depot"
            ],
            "created_at": null,
            "updated_at": null,
            "slug": "takii-company-ltd",
            "name": "Takii & Company Ltd.",
            "snippet": "Takii was established in 1835, starting as a seed store, dealing seeds of ...",
            "logo": null,
            "average_rating": 0,
            "star_rating": 0,
            "permission": "database-only",
            "provisional": false,
            "score": 0.0,
            "tier": null,
            "locations": [],
            "headquarters_country": null,
            "sort_value": 0.0,
            "agreed_to_vendor_terms_at": null,
            "contract_pending": null,
            "contract_status": "Not signed up",
            "provider_annotations": [],
            "contact_emails": [
                "unregistered@assaydepot.com"
            ],
            "representative_gsls": {},
            "signed_legal_documents": [],
            "cached_annotations": [],
            "total_requests": 0,
            "total_requests_completed": 0
        }
    ]
}

Query Parameters

Parameter Default Description
page 1 When there are more results than can fit on a single page, you can retrieve different pages by changing this parameter.
per_page 25 You can change the number of results returned per request by changing this parameter.
sort_by nil (relevance) You can change the order in which results are returned. This orders the entire result set, not just the current page.
sort_order 1 Change the direction of the result set.

Provider Associated Wares

Return an object containing all wares for a specific provider identifier.

ware = AssayDepot::ProviderWare.get( 2074 )
curl "http://app.scientist.com/api/v2/providers/2074/wares.json"
  -H "Authorization: Bearer [bearer_token]"
api.provider_ware.get( 2074 ).then(({providers}) => {
    // do something...
});

HTTP Request

GET http://app.scientist.com/api/v2/providers/:provider_id/wares.json

The providers-wares command returns JSON structured like this:

{
    "total": 14,
    "page": 1,
    "per_page": 100,
    "query_time": 0.543993,
    "ware_refs": [
        {
            "currency": null,
            "id": 2291,
            "beacon_ids": [],
            "catalog_id": "5aaf8d8c3084e7ebb6c790644a5dcf8c",
            "name": "Natural Product Fermentation",
            "price": 0.0,
            "promo_image": "natural-products.png",
            "provider_ids": [
                2074,
                2074
            ],
            "provider_names": [
                "Takii & Company Ltd.",
                "Takii & Company Ltd."
            ],
            "slug": "n-product-fermentation",
            "snippet": "Produce large amounts of natural products.",
            "sort_value": 1,
            "turn_around_time": null,
            "ware_type": "CustomService",
            "created_at": "2009-10-07T00:26:34.000Z",
            "updated_at": "2019-05-25T08:21:34.408Z"
        },
        ...
    ]
}

Query Parameters

Refer to Query Parameters

Remove Ware-Provider Association

Remove associations between specific :ware_id and :provider_id by DELETEing at the /ware/:ware_id/provider/:provider_id endpoint.

# WareProvider.post takes :ware_id and :provider_id as its arguments
response = AssayDepot::WareProvider.delete( 2291, 2074 )
response["result"] 
=> "OK"
curl -X DELETE "http://app.scientist.com/api/v2/wares/2291/providers/2074.json"
  -H "Authorization: Bearer [bearer_token]"
api.ware_provider.delete( 2291, 2074 ).then(({response}) => {
    console.log(response.result)
    // "OK"
});

The above command returns JSON structured like this:

{"result": "OK"}

The server responds with the following for duplicate deletions:

{
    "message": "Provider is not published.",
    "code": "unprocessable_entity"
}

If you DELETE an association more than 1 time, the server will respond without changing the association.

Quote Groups

Marketplace "quote groups" refer to the customer view of a request for quote for specific goods and services. By contrast, a quoted ware represents the provider view of the similar information.

All Quote Groups

Use /quote_groups.json to request the first page of quote group documents visible to the requestor.

HTTP Request

GET http://app.scientist.com/api/v2/quote_groups.json

quote_group = AssayDepot::QuoteGroup.get()
quote_group.length
=> 2
curl "http://app.scientist.com/api/v2/quote_groups.json"
  -H "Authorization: Bearer [bearer_token]"
api.quote_group.get().then(({quote_group}) => {
    console.log(quote_group.length)
    // => 2
});

The above command returns JSON structured like this:

[
    {
        "_index": "pg_quote_groups_development_20200501130126333",
        "_type": "pg/quote_group",
        "_id": 4,
        "_score": null,
        "sort": [
            1588364834224
        ],
        "id": 4,
        "uuid": "f58af501-31b2-42b4-8940-d3b7967e49e2",
        "identifier": "7E49E2",
        "name": "a new request for dragon",
        "name_facet": "a new request for dragon",
        "description": "<p>lets see this go to dragon</p>",
        "plain_description": "lets see this go to dragon",
        "state": "Vendor Review",
        "status": "Vendor Review",
        "type": [],
        "discipline": null,
        "email": [
            "ron@scientist.com"
        ],
        "requestor": "Ron Ranauro",
        "requestor_email": "ron@scientist.com",
        "request_type": null,
        "user_ref": {
            "id": null,
            "fields": {
                "first_name": "Ron",
                "last_name": "Ranauro",
                "organization_name": null,
                "email": "ron@scientist.com",
                "title": "Chief Requestor",
                "company": "MyCompany, Inc.",
                "site": null,
                "discipline": null,
                "created_at": "2020-05-01T10:01:18.269-07:00",
                "confirmed_at": "2020-05-01T10:01:18.254-07:00",
                "is_admin": true,
                "site_rep": true,
                "b2b": null
            },
            "reference_of_type": "Pg::User",
            "reference_of_id": 4,
            "reference_to_id": null,
            "uuid": null,
            "origin": "5am",
            "access": [
                "depot"
            ],
            "created_at": "2020-05-01T10:01:18.269-07:00",
            "updated_at": null
        },
        "ware_ref": {
            "id": null,
            "reference_of_type": "Pg::Ware",
            "reference_of_id": 1,
            "reference_to_id": null,
            "uuid": null,
            "origin": "central-staging",
            "access": [
                "depot",
                "acme",
                "alexion",
                "az",
                "bayer",
                "bms",
                "celgene",
                "nci",
                "novartis",
                "pfizer",
                "sanofi"
            ],
            "created_at": "2020-05-01T09:57:28.730-07:00",
            "updated_at": "2020-05-01T09:57:28.730-07:00",
            "cxml_enabled?": true,
            "beacon_ids": [],
            "catalog_id": "5aaf8d8c3084e7ebb6c790644a5dcf8c",
            "name": "New Request",
            "promo_image": null,
            "provider_ids": [],
            "provider_names": [],
            "slug": "make-a-request",
            "snippet": "Make a request",
            "sort_value": 0,
            "ware_type": "CustomService"
        },
        "note_count": 4,
        "note_titles": [
            "Compliance Manifest Submitted and Auto Approved",
            "Request Updated",
            "Request Updated",
            null
        ],
        "note_bodies": [
            "The Request Compliance Manifest for #7E49E2 a new request for dragon has been submitted.",
            "R R has updated this request.",
            "R R has updated this request.",
            "<p>Hey Dragon, whats up?</p>"
        ],
        "proposals": [],
        "ware_name": "New Request",
        "purchase_requisition_ids": [],
        "ad_pr_numbers": [],
        "ad_po_numbers": [],
        "purchase_order_numbers": [],
        "invoice_numbers": [],
        "provider_names": [
            "Dragon Pharmacology"
        ],
        "vendor": [
            "Dragon Pharmacology"
        ],
        "compliance_required": true,
        "compliance_status": "Submitted",
        "compliance_waiting_on_names": [],
        "filters": [],
        "dynamic_form_name": null,
        "assignees": [],
        "assignee_emails": [],
        "followers": [],
        "private_request": null,
        "client_id": null,
        "winning_quoted_ware_ids": [],
        "winning_proposal_id": null,
        "request_updated_at": "2020-05-01T13:30:13.884-07:00",
        "price_range": {
            "minmax": [],
            "currency": null
        },
        "winning_provider_names": null,
        "winning_total_prices": null,
        "winning_currencies": null,
        "client_application": null,
        "promo_code": null,
        "updated_at": "2020-05-01T13:28:24.794-07:00",
        "created_at": "2020-05-01T13:27:14.224-07:00",
        "placed_at": null,
        "origin": "depot",
        "access": [
            "depot",
            "central-staging"
        ],
        "timepoints": {
            "Request_date": "2020-04-30",
            "Vendor_review_date": null,
            "Estimate_submission_date": null,
            "SOW_requested_date": null,
            "SOW_submitted_date": null,
            "SOW_acceptance_date": null,
            "PO_issue_date": null,
            "All_starting_material_received_date": null,
            "Actual_work_start_date": null,
            "Final_report_deliver_date": null,
            "Final_material_deliver_date": null,
            "Estimated_completion_date": null,
            "Project_completion_date": null
        },
        "filter1": null,
        "filter2": null,
        "filter3": null,
        "quote_group_totals": {
            "invoice": 0,
            "amendment": 0,
            "estimate": 0,
            "sow": 0,
            "purchase_order": 0,
            "purchase_requisition": 0,
            "message": 1
        }
    },
    {
        "_index": "pg_quote_groups_development_20200501130126333",
        "_type": "pg/quote_group",
        "_id": 1,
        "_score": null,
        "sort": [
            1588353639297
        ],
        "id": 1,
        "uuid": "0537d6de-ae67-4570-a5c8-92e3f93ca5f3",
        "identifier": "3CA5F3",
        "name": "first request",
        "name_facet": "first request",
        "description": "<p>request #1 destined for Dragon</p>",
        "plain_description": "request #1 destined for Dragon",
        "state": "Vendor Review",
        "status": "Vendor Review",
        "type": [],
        "discipline": null,
        "email": [
            "ron@scientist.com"
        ],
        "requestor": "Ron Ranauro",
        "requestor_email": "ron@scientist.com",
        "request_type": null,
        "user_ref": {
            "id": null,
            "fields": {
                "first_name": "Ron",
                "last_name": "Ranauro",
                "organization_name": null,
                "email": "ron@scientist.com",
                "title": "Chief Requestor",
                "company": "MyCompany, Inc.",
                "site": null,
                "discipline": null,
                "created_at": "2020-05-01T10:01:18.269-07:00",
                "confirmed_at": "2020-05-01T10:01:18.254-07:00",
                "is_admin": true,
                "site_rep": true,
                "b2b": null
            },
            "reference_of_type": "Pg::User",
            "reference_of_id": 4,
            "reference_to_id": null,
            "uuid": null,
            "origin": "5am",
            "access": [
                "depot"
            ],
            "created_at": "2020-05-01T10:01:18.269-07:00",
            "updated_at": null
        },
        "ware_ref": {
            "id": null,
            "reference_of_type": "Pg::Ware",
            "reference_of_id": 1,
            "reference_to_id": null,
            "uuid": null,
            "origin": "central-staging",
            "access": [
                "depot",
                "acme",
                "alexion",
                "az",
                "bayer",
                "bms",
                "celgene",
                "nci",
                "novartis",
                "pfizer",
                "sanofi"
            ],
            "created_at": "2020-05-01T09:57:28.730-07:00",
            "updated_at": "2020-05-01T09:57:28.730-07:00",
            "cxml_enabled?": true,
            "beacon_ids": [],
            "catalog_id": "5aaf8d8c3084e7ebb6c790644a5dcf8c",
            "name": "New Request",
            "promo_image": null,
            "provider_ids": [],
            "provider_names": [],
            "slug": "make-a-request",
            "snippet": "Make a request",
            "sort_value": 0,
            "ware_type": "CustomService"
        },
        "note_count": 15,
        "note_titles": [
            "Compliance Manifest Submitted and Auto Approved",
            "Request Updated",
            "Request Updated",
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            "Request Updated",
            null,
            null
        ],
        "note_bodies": [
            "The Request Compliance Manifest for #3CA5F3 first request has been submitted.",
            "R R has updated this request.",
            "R R has updated this request.",
            "<p>try again</p>",
            "<p>my message</p>",
            "<p>another message</p>",
            "<p>try</p>",
            "<p>yup</p>",
            "<p>more</p>",
            "<p>now</p>",
            "<p>once more</p>",
            "<p>yup</p>",
            "The system has updated this request.",
            "<p>see it now</p>",
            "<p>This time.</p>"
        ],
        "proposals": [],
        "ware_name": "New Request",
        "purchase_requisition_ids": [],
        "ad_pr_numbers": [],
        "ad_po_numbers": [],
        "purchase_order_numbers": [],
        "invoice_numbers": [],
        "provider_names": [
            "Dragon Pharmacology"
        ],
        "vendor": [
            "Dragon Pharmacology"
        ],
        "compliance_required": true,
        "compliance_status": "Submitted",
        "compliance_waiting_on_names": [],
        "filters": [],
        "dynamic_form_name": null,
        "assignees": [],
        "assignee_emails": [],
        "followers": [],
        "private_request": null,
        "client_id": null,
        "winning_quoted_ware_ids": [],
        "winning_proposal_id": null,
        "request_updated_at": "2020-05-01T10:58:16.584-07:00",
        "price_range": {
            "minmax": [],
            "currency": null
        },
        "winning_provider_names": null,
        "winning_total_prices": null,
        "winning_currencies": null,
        "client_application": null,
        "promo_code": null,
        "updated_at": "2020-05-01T10:22:15.097-07:00",
        "created_at": "2020-05-01T10:20:39.297-07:00",
        "placed_at": null,
        "origin": "depot",
        "access": [
            "depot",
            "central-staging"
        ],
        "timepoints": {
            "Request_date": "2020-04-30",
            "Vendor_review_date": "2020-05-01",
            "Estimate_submission_date": null,
            "SOW_requested_date": null,
            "SOW_submitted_date": null,
            "SOW_acceptance_date": null,
            "PO_issue_date": null,
            "All_starting_material_received_date": null,
            "Actual_work_start_date": null,
            "Final_report_deliver_date": null,
            "Final_material_deliver_date": null,
            "Estimated_completion_date": null,
            "Project_completion_date": null
        },
        "filter1": null,
        "filter2": null,
        "filter3": null,
        "quote_group_totals": {
            "invoice": 0,
            "amendment": 0,
            "estimate": 0,
            "sow": 0,
            "purchase_order": 0,
            "purchase_requisition": 0,
            "message": 11
        }
    }
]

Mine

This endpoint retrieves all quote group documents visible to the requestor.

The response from /quote_groups/mine.json is similar to the /quote_groups.json endpoint. However the response object is structured with a facets object and an array of quote_group_refs. Use the quote group query parameters to control the page number and number of documents per page you want the server to respond with.

HTTP Request

GET http://app.scientist.com/api/v2/quote_groups/mine.json

quote_group = AssayDepot::QuoteGroup.get('mine')
quote_group["count"]
=> 2
quote_group[AssayDepot::QuoteGroup.ref_name]
curl "http://app.scientist.com/api/v2/quote_groups/mine.json"
  -H "Authorization: Bearer [bearer_token]"
api.quote_group.get('mine').then(({quote_group}) => {
    console.log(quote_group.count)
    // => 2
});

The above command returns JSON structured like this:

{
    "pages": 1,
    "per_page": 25,
    "facets": {
        "client_application": {},
        "requestor": {
            "Ron Ranauro": 2
        },
        "vendor": {},
        "dynamic_form_name": {},
        "assignee_emails": {},
        "status": {
            "Internal Review": 2
        }
    },
    "count": 2,
    "number_of_pages": 1,
    "query_time": 0.261562
    "quote_group_refs": [
        {
            "id": 2,
            "_id": 2,
            "followers": [],
            "assignees": [],
            "customer_accounting_email": null,
            "beacon_ids": [],
            "acceptable_currencies": [],
            "client_id": null,
            "site": null,
            "therapeutic_area": null,
            "promo_code": null,
            "name": "New Request",
            "description": "<p>something I need</p>",
            "data": {},
            "dynamic_forms": [],
            "consolidated_billing": true,
            "manager_purchase_only": true,
            "scanned_signature_required": false,
            "providers_visible": null,
            "purchase_more": null,
            "state": "Internal Review",
            "closed": false,
            "cancelled": false,
            "on_hold": false,
            "status": "Internal Review",
            "billing_same_as_shipping": true,
            "ordered_at": null,
            "placed_at": null,
            "exclude_from_reporting": false,
            "reason_for_cancelling": null,
            "proposed_deadline": "2019-11-14T07:59:59.999Z",
            "updated_at": "2019-11-06T15:45:44.792Z",
            "created_at": "2019-11-06T15:45:44.792Z",
            "organization_id": 4,
            "organization_uuid": "98470754-d263-456f-9361-81fa309699ea",
            "user": {
                "first_name": "Ron",
                "last_name": "Ranauro",
                "email": "ron@scientist.com",
                "title": null,
                "company": null,
                "site": null,
                "discipline": null,
                "id": 1
            },
            "shipping_address": {
                "id": 6,
                "organization_name": "Incite Advisors, Inc.",
                "street": "19 Goddard Drive",
                "street2": "",
                "city": "Auburn",
                "state": "Massachusetts",
                "zipcode": "01501",
                "country": "US",
                "latitude": null,
                "longitude": null,
                "name": null,
                "attention": "",
                "person_name": "Ronald Ranauro",
                "care_of": null,
                "text": "19 Goddard Drive\n\nAuburn, Massachusetts, 01501\nUnited States"
            },
            "billing_address": {
                "id": 7,
                "organization_name": "Incite Advisors, Inc.",
                "street": "19 Goddard Drive",
                "street2": "",
                "city": "Auburn",
                "state": "Massachusetts",
                "zipcode": "01501",
                "country": "US",
                "latitude": null,
                "longitude": null,
                "name": null,
                "attention": "",
                "person_name": "Ronald Ranauro",
                "care_of": null,
                "text": "19 Goddard Drive\n\nAuburn, Massachusetts, 01501\nUnited States"
            },
            "remittance_address": {
                "id": 8,
                "organization_name": "The Assay Depot, Inc",
                "street": "505 Lomas Santa Fe Drive, Suite 110",
                "street2": null,
                "city": "Solana Beach",
                "state": "CA",
                "zipcode": "92075",
                "country": "US",
                "latitude": null,
                "longitude": null,
                "name": null,
                "attention": null,
                "person_name": "DBA: Scientist.com",
                "care_of": null,
                "text": "505 Lomas Santa Fe Drive, Suite 110\nSolana Beach, CA, 92075\nUnited States"
            },
            "ware_ref": {
                "id": 2,
                "slug": "make-a-request",
                "name": "New Request",
                "price": 0,
                "type": "CustomService",
                "turn_around_time": {
                    "table": {}
                },
                "snippet": "Make a request",
                "html_snippet": "<p>Make a request</p>",
                "providers": [],
                "urls": {
                    "storefront": "https://app.scientist.com/wares/make-a-request/quote_groups/new",
                    "backoffice": "https://backoffice-staging.scientist.com/wares/make-a-request/edit"
                }
            }
        },
        {
            "id": 1,
            "_id": 1,
            "followers": [],
            "assignees": [],
            "customer_accounting_email": null,
            "beacon_ids": [],
            "acceptable_currencies": [],
            "client_id": null,
            "site": null,
            "therapeutic_area": null,
            "promo_code": null,
            "name": "my request",
            "description": "<p>i need data</p>",
            "data": {},
            "dynamic_forms": [],
            "consolidated_billing": true,
            "manager_purchase_only": true,
            "scanned_signature_required": false,
            "providers_visible": null,
            "purchase_more": null,
            "state": "Internal Review",
            "closed": false,
            "cancelled": false,
            "on_hold": false,
            "status": "Internal Review",
            "billing_same_as_shipping": true,
            "ordered_at": null,
            "placed_at": null,
            "exclude_from_reporting": false,
            "reason_for_cancelling": null,
            "proposed_deadline": "2019-11-14T07:59:59.999Z",
            "updated_at": "2019-11-06T11:22:33.461Z",
            "created_at": "2019-11-06T11:22:33.461Z",
            "organization_id": 4,
            "organization_uuid": "98470754-d263-456f-9361-81fa309699ea",
            "user": {
                "first_name": "Ron",
                "last_name": "Ranauro",
                "email": "ron@scientist.com",
                "title": null,
                "company": null,
                "site": null,
                "discipline": null,
                "id": 1
            },
            "shipping_address": {
                "id": 1,
                "organization_name": "Incite Advisors, Inc.",
                "street": "19 Goddard Drive",
                "street2": "",
                "city": "Auburn",
                "state": "Massachusetts",
                "zipcode": "01501",
                "country": "US",
                "latitude": null,
                "longitude": null,
                "name": null,
                "attention": "",
                "person_name": "Ronald Ranauro",
                "care_of": null,
                "text": "19 Goddard Drive\n\nAuburn, Massachusetts, 01501\nUnited States"
            },
            "billing_address": {
                "id": 2,
                "organization_name": "Incite Advisors, Inc.",
                "street": "19 Goddard Drive",
                "street2": "",
                "city": "Auburn",
                "state": "Massachusetts",
                "zipcode": "01501",
                "country": "US",
                "latitude": null,
                "longitude": null,
                "name": null,
                "attention": "",
                "person_name": "Ronald Ranauro",
                "care_of": null,
                "text": "19 Goddard Drive\n\nAuburn, Massachusetts, 01501\nUnited States"
            },
            "remittance_address": {
                "id": 3,
                "organization_name": "The Assay Depot, Inc",
                "street": "505 Lomas Santa Fe Drive, Suite 110",
                "street2": null,
                "city": "Solana Beach",
                "state": "CA",
                "zipcode": "92075",
                "country": "US",
                "latitude": null,
                "longitude": null,
                "name": null,
                "attention": null,
                "person_name": "DBA: Scientist.com",
                "care_of": null,
                "text": "505 Lomas Santa Fe Drive, Suite 110\nSolana Beach, CA, 92075\nUnited States"
            },
            "ware_ref": {
                "id": 1,
                "slug": "make-a-request",
                "name": "New Request",
                "price": 0,
                "type": "CustomService",
                "turn_around_time": {
                    "table": {}
                },
                "snippet": "Make a request",
                "html_snippet": "<p>Make a request</p>",
                "providers": [],
                "urls": {
                    "storefront": "https://app.scientist.com/wares/make-a-request/quote_groups/new",
                    "backoffice": "https://backoffice-staging.scientist.com/wares/make-a-request/edit"
                }
            }
        }
    ]
}

The /quote_groups/mine.json endpoint allows for faceted searching. Use the facets property in the response object to query and refine quote group results. For details on using the facets property and creating faceted query strings, refer to Wares Faceted Search.

Query Parameters

Parameter Default Description
page 1 When there are more results than can fit on a single page, you can retrieve different pages by changing this parameter.
per_page 25 You can change the number of results returned per request by changing this parameter.
sort_by nil (relevance) You can change the order in which results are returned. This orders the entire result set, not just the current page.
sort_order 1 Change the direction of the result set.
facets nil You can refine the result set by specifying facet values. See Wares Faceted Search for more information.

A Quote Group

This endpoint retrieves quote groups associated with a specific quote group identifier. Each quote group is indexed uniquely by the id found in the /quote_groups.json response object. Use id to request a spcific quote group.

HTTP Request

GET http://app.scientist.com/api/v2/quote_groups/:quote_group_id.json

quote_group = AssayDepot::QuoteGroup.get( 2 )
quote_group["location"]
=> "http://dev.scientist.com:3000/api/v2/quote_groups/9af431b2-59fb-4ed4-8869-7801701194c2"
quote_group["result"]
curl "http://app.scientist.com/api/v2/quote_groups/2.json"
  -H "Authorization: Bearer [bearer_token]"
api.quote_group.get( 2 ).then(({quote_group}) => {
    console.log(quote_group.location)
    // "http://dev.scientist.com:3000/api/v2/quote_groups/9af431b2-59fb-4ed4-8869-7801701194c2"
});

API V1 Response

In API V1 the quote group object is structured with result and location properties for the requested quoted group and the associated url respectively.

With API V1 the above command returns JSON structured like this:

{
   "result":{
      "id":2,
      "_id":2,
      "followers":[

      ],
      "assignees":[

      ],
      "customer_accounting_email":null,
      "beacon_ids":[

      ],
      "acceptable_currencies":[

      ],
      "client_id":null,
      "site":null,
      "therapeutic_area":null,
      "promo_code":null,
      "name":"Test QuoteGroup",
      "description":"\u003cp\u003ePants\u003c/p\u003e",
      "data":{

      },
      "dynamic_forms":[

      ],
      "consolidated_billing":false,
      "manager_purchase_only":false,
      "scanned_signature_required":false,
      "providers_visible":null,
      "purchase_more":null,
      "state":"Internal Review",
      "closed":false,
      "cancelled":false,
      "on_hold":false,
      "status":"Internal Review",
      "billing_same_as_shipping":true,
      "ordered_at":null,
      "placed_at":null,
      "exclude_from_reporting":false,
      "reason_for_cancelling":null,
      "proposed_deadline":null,
      "updated_at":"2019-10-29T16:48:16.873Z",
      "created_at":"2019-10-29T16:48:16.873Z",
      "user":{
         "first_name":"Gladyce",
         "last_name":"Hegmann",
         "email":"gladyce4@scientist.com",
         "title":null,
         "company":"Assay Depot",
         "site":null,
         "discipline":null,
         "id":5
      },
      "shipping_address":{
         "id":9,
         "organization_name":"org name",
         "street":"1219 Bashirian Mount",
         "street2":null,
         "city":"Llewellynmouth",
         "state":"MT",
         "zipcode":"66372-9899",
         "country":"CD",
         "latitude":null,
         "longitude":null,
         "name":"provider name",
         "attention":"attention line",
         "person_name":"person name",
         "care_of":"care of person",
         "text":"1219 Bashirian Mount\nLlewellynmouth, MT, 66372-9899\nCongo (Dem. Rep.)"
      },
      "ware_ref":{
         "id":4,
         "slug":"polly-jeffries62",
         "name":"Polly Jeffries",
         "price":0,
         "type":"Product",
         "turn_around_time":{
            "table":{

            }
         },
         "snippet":"Down the road that's where I'll always be. Every stop I make I make a new friend; Can't stay for long just turn around and I'm gone again. \n\n",
         "html_snippet":"\u003cp\u003eDown the road that\u0026#8217;s where I\u0026#8217;ll always be. Every stop I make I make a new friend; Can\u0026#8217;t stay for long just turn around and I\u0026#8217;m gone again.\u003c/p\u003e",
         "providers":[

         ],
         "urls":{
            "storefront":"https://app.scientist.com/wares/polly-jeffries62/quote_groups/new",
            "backoffice":"https://backoffice-staging.scientist.com/wares/polly-jeffries62/edit"
         }
      }
   },
   "location":"http://app.scientist.com/api/v2/quote_groups/94cc2e8d-0a7e-4d1c-bf9d-fb2f8b22288b",
   "query_time":0.007109
}

API V2 Response

The API V2 endpoint returns the requested quote group as a json object.

Using API V2 the above command returns JSON structured like this:

{
    "id": 4,
    "_id": 4,
    "identifier": "7E49E2",
    "followers": [],
    "assignees": [],
    "customer_accounting_email": null,
    "beacon_ids": [],
    "acceptable_currencies": [],
    "client_id": null,
    "organization_id": 6,
    "organization_uuid": "de9b1394-aefe-41b6-8294-030000d01e3d",
    "site": null,
    "therapeutic_area": "Oncology",
    "promo_code": null,
    "name": "a new request for dragon",
    "description": "<p>lets see this go to dragon</p>",
    "data": {},
    "dynamic_forms": [],
    "consolidated_billing": true,
    "manager_purchase_only": true,
    "scanned_signature_required": false,
    "providers_visible": null,
    "purchase_more": null,
    "state": "Vendor Review",
    "closed": false,
    "cancelled": false,
    "on_hold": false,
    "status": "Vendor Review",
    "billing_same_as_shipping": true,
    "ordered_at": null,
    "placed_at": null,
    "exclude_from_reporting": false,
    "reason_for_cancelling": null,
    "proposed_deadline": "2020-05-09T06:59:59.999Z",
    "updated_at": "2020-05-01T20:28:24.794Z",
    "created_at": "2020-05-01T20:27:14.224Z",
    "user": {
        "first_name": "Ron",
        "last_name": "Ranauro",
        "email": "ron@scientist.com",
        "title": "Chief Requestor",
        "company": "MyCompany, Inc.",
        "site": null,
        "discipline": null,
        "id": 4
    },
    "shipping_address": {
        "id": 70,
        "organization_name": "Windmill Estates c/o Phoenix Mgt",
        "street": "650 Lincoln Street",
        "street2": "",
        "city": "Worcester",
        "state": "MA",
        "zipcode": "01605",
        "country": "US",
        "latitude": null,
        "longitude": null,
        "name": null,
        "attention": "",
        "person_name": "",
        "care_of": null,
        "text": "650 Lincoln Street\n\nWorcester, MA, 01605\nUnited States"
    },
    "billing_address": {
        "id": 71,
        "organization_name": "Windmill Estates c/o Phoenix Mgt",
        "street": "650 Lincoln Street",
        "street2": "",
        "city": "Worcester",
        "state": "MA",
        "zipcode": "01605",
        "country": "US",
        "latitude": null,
        "longitude": null,
        "name": null,
        "attention": "",
        "person_name": "",
        "care_of": null,
        "text": "650 Lincoln Street\n\nWorcester, MA, 01605\nUnited States"
    },
    "remittance_address": {
        "id": 72,
        "organization_name": "The Assay Depot, Inc",
        "street": "505 Lomas Santa Fe Drive, Suite 110",
        "street2": null,
        "city": "Solana Beach",
        "state": "CA",
        "zipcode": "92075",
        "country": "US",
        "latitude": null,
        "longitude": null,
        "name": null,
        "attention": null,
        "person_name": "DBA: Scientist.com",
        "care_of": null,
        "text": "505 Lomas Santa Fe Drive, Suite 110\nSolana Beach, CA, 92075\nUnited States"
    },
    "ware_ref": {
        "id": 9,
        "slug": "make-a-request",
        "name": "New Request",
        "type": "CustomService",
        "snippet": "Make a request",
        "html_snippet": "<p>Make a request</p>",
        "providers": [
            {
                "id": 6,
                "uuid": "a8bd8c4f-afd0-41bb-bd91-740ab9a717f0",
                "slug": "dragon-pharmacology",
                "name": "Dragon Pharmacology",
                "snippet_plain": "Dragon Pharmacology provides research models for various diseases. Dragon Pharmacology is a trusted TEST vendor for pharmacological animal models.\nTest Company for Demos",
                "snippet": "Dragon Pharmacology provides research models for various diseases. Dragon Pharmacology is a trusted *TEST* vendor for pharmacological animal models.\r\n\r\n**Test Company for Demos**",
                "html_snippet": "<p>Dragon Pharmacology provides research models for various diseases. Dragon Pharmacology is a trusted <strong>TEST</strong> vendor for pharmacological animal models.</p>\n<p><b>Test Company for Demos</b></p>",
                "description": "Dragon Pharmacology provides research models for various diseases. Dragon Pharmacology is a trusted TEST vendor for pharmacological animal models.",
                "html_description": "<p>Dragon Pharmacology provides research models for various diseases. Dragon Pharmacology is a trusted TEST vendor for pharmacological animal models.</p>",
                "average_rating": null,
                "permission": "in-network",
                "locations": [
                    {
                        "id": 52,
                        "organization_name": null,
                        "street": "123 Folk Street",
                        "street2": "",
                        "city": "Oak",
                        "state": "CA",
                        "zipcode": "98122",
                        "country": "US",
                        "latitude": null,
                        "longitude": null,
                        "name": null,
                        "attention": null,
                        "person_name": null,
                        "care_of": null,
                        "text": "123 Folk Street\n\nOak, CA, 98122\nUnited States"
                    },
                    {
                        "id": 53,
                        "organization_name": null,
                        "street": "125 North Acacia Avenue",
                        "street2": "",
                        "city": "Solana Beach",
                        "state": "CA",
                        "zipcode": "92075",
                        "country": "US",
                        "latitude": "32.9924955",
                        "longitude": "-117.2728702",
                        "name": null,
                        "attention": null,
                        "person_name": null,
                        "care_of": null,
                        "text": "125 North Acacia Avenue\n\nSolana Beach, CA, 92075\nUnited States"
                    },
                    {
                        "id": 54,
                        "organization_name": null,
                        "street": "12 great barton",
                        "street2": "",
                        "city": "Great Barton",
                        "state": "England",
                        "zipcode": "IP31 2RU",
                        "country": "GB",
                        "latitude": "52.2743395",
                        "longitude": "0.7678092",
                        "name": null,
                        "attention": null,
                        "person_name": null,
                        "care_of": null,
                        "text": "12 great barton\n\nGreat Barton, England, IP31 2RU\nUnited Kingdom"
                    }
                ],
                "urls": {
                    "storefront": "https://app.scientist.com/wares/make-a-request/quote_groups/new?provider=Dragon+Pharmacology&name=Dragon+Pharmacology",
                    "backoffice": "https://backoffice-staging.scientist.com/providers/dragon-pharmacology/edit"
                },
                "score": 0.0
            }
        ],
        "urls": {
            "storefront": "https://app.scientist.com/wares/make-a-request/quote_groups/new",
            "backoffice": "https://backoffice-staging.scientist.com/wares/make-a-request/edit"
        }
    }
}

Quote Group Collections

The API allows you to fetch arrays of documents attached to Quote Groups including Internal Messages, Compliance Manifests and Participating Providers.

The quote group collections endpoint responds with an array of the requested object.

An example internal message is show below:

[{
    "id": 2,
    "title": null,
    "status": null,
    "body": "Another payload",
    "attachments": [{
        "filename": "image.png",
        "content_type": "image/png",
        "content_length": "70 Bytes",
        "created_at": "2020-01-07T14:35:08.921Z",
        "urls": {
            "download": "https://app.scientist.com/secure_attachments/a2166a6e-8a80-49e0-a1f7-8831b0932fe4"
        }
    }],
    "created_by": "Cristian O'Kon",
    "created_at": "2020-01-07T14:35:08.901Z",
    "updated_at": "2020-01-07T14:35:08.901Z",
    "user_ref": {
        "first_name": "Cristian",
        "last_name": "O'Kon",
        "email": "cristian7@scientist.com",
        "title": null,
        "company": "Assay Depot",
        "site": null,
        "discipline": null,
        "id": null
    }
}]

Request documents attached to specific quote group identifier.

HTTP Request

GET http://app.scientist.com/api/v1/quote_groups/:quote_group_id/internal_messages.json

GET http://app.scientist.com/api/v1/quote_groups/:quote_group_id/compliance_manifest.json

GET http://app.scientist.com/api/v1/quote_groups/:quote_group_id/participating_provider.json

Internal Messages

Refer to Quote Group Collections

Compliance Manifest

Refer to Quote Group Collections

Participating Provider

Refer to Quote Group Collections

Notes

Owners of quote group records can amend a quote group with a note using the POST verb to the /quote_group/:id/notes.json endpoint. In the case of API V1, use /quote_group/:id/add_note.json.

response = AssayDepot::AddNote.post(2, {
    note: {
      title: "a new title",
      body: "some body text"
    }
})
curl -X POST "http://app.scientist.com/api/quote_groups/:quote_group_id/notes.json"
  -H "Authorization: Bearer [bearer_token]" -d"{"quote_group":{"note":{"title":"a new title"}}}"
api.add_note.post( 2, {
    note: {
      title: "a new title",
      body: "some body text"
    }
} ).then(({msg}) => {
    // do something
});

The POST body expects a JSON structure like this:

{
    "note": {
      "title": "some title text",
      "body": "note body text",
    }
}

Using API V1, the above command returns JSON object with the following structure:

{
    "msg": "note saved"
}

The API V2, returns the following response:

{
    "message": "Timeline Updated"
}

Associate a note with a specific quote group identifier.

HTTP Request

POST http://app.scientist.com/api/v1/quote_groups/:quote_group_id/add_note.json

POST http://app.scientist.com/api/v2/quote_groups/:quote_group_id/notes.json

Quoted Wares

Marketplace "quoted wares" refer to provider view of a request for goods and services initiated by a client on the system. By contrast, a quote group represents the client view of similar information.

Note that all Quoted Wares are attached to Quote Groups in the database. All endpoints will verify that the requested member belongs to a valid quote group and that the requestor has permission to access members of the quote group.

All Quoted Wares

Returns all quoted wares associated with the requesting user. The server responds with an object containing the first page of quoted wares.

This endpoint retrieves all quotes associated with the requesting user.

HTTP Request

GET http://app.scientist.com/api/v2/quoted_wares.json

quote_ware = AssayDepot::QuotedWare.get()
quote_ware["total"]
=> 1
quote_ware[AssayDepot::QuotedWare.ref_name]
curl "http://app.scientist.com/api/v2/quoted_wares_.json"
  -H "Authorization: Bearer [bearer_token]"
api.quoted_ware.get().then(({quote_ware}) => {
    console.log(quoted_ware.total)
    // => 1
});

The API V1 response is shown below. The corresponding API V2 response includes only the array found at quoted_ware_refs in the sample shown:

{
    "total": 1,
    "page": 1,
    "per_page": 25,
    "query_time": 0.021472,
    "facets": {
        "requestor_company": {
            "Assay Depot": 1
        },
        "request_type": {},
        "vendor": {
            "Harber Inc--15": 1
        },
        "origin": {
            "depot": 1
        },
        "assignee_emails": {},
        "requestor": {
            "K M": 1
        },
        "status": {
            "Internal Review": 1
        }
    },
    "quoted_ware_refs": [{
        "requestor_organization": "Scientist.com",
        "quote_id": "aa6afac0-ec50-4bab-a705-814d62487789",
        "group_id": "2933bae4-4e02-4427-8646-45149844427e",
        "supplier_identifier": null,
        "request_identifier": "44427E",
        "title": "Test QuoteGroup",
        "proposal_identifier": null,
        "proposal_obsolete": "active",
        "total_price": null,
        "shipping_cost": null,
        "tax_cost": null,
        "submitted_subtotal_price(retail)": null,
        "submitted_subtotal_price(wholesale)": null,
        "number_of_times_purchased": 0,
        "cumulative_retail_price": null,
        "cumulative_wholesale_price": null,
        "transaction_fee(%)": "%",
        "status": "Internal Review",
        "reason_for_cancelling": null,
        "reason_for_supplier_declining": null,
        "discipline": "other",
        "category": null,
        "user_email": "keely6@scientist.com",
        "provider_name": "Harber Inc--15",
        "vendor_contacts": "15test@example.com",
        "followers": [],
        "requestor_state": "CO",
        "requestor_country": "MW",
        "ware_id": 5,
        "ware_slug": "barbara-dent0",
        "created_date": "2019-11-14T17:07:15.321Z",
        "updated_date": "2019-11-14T17:07:15.321Z",
        "turn_around_adjusted_min": "-",
        "turn_around_adjusted_max": "-",
        "turn_around_units": "-",
        "ad_po_number": "",
        "Project_completion_date": null,
        "Estimated_completion_date": null,
        "Final_material_deliver_date": null,
        "Final_report_deliver_date": null,
        "Actual_work_start_date": null,
        "All_starting_material_received_date": null,
        "PO_issue_date": null,
        "SOW_acceptance_date": null,
        "SOW_submitted_date": null,
        "SOW_requested_date": null,
        "Estimate_submission_date": null,
        "Vendor_review_date": null,
        "Request_date": "2019-11-14T00:00:00.000Z"
    }],
    "options": {
        "facets": null,
        "page": 1,
        "per_page": 25,
        "sort_by": null,
        "sort_order": "desc",
        "provider_id": [15],
        "vendor_follower": "My Companies"
    }
}

Search Quoted Wares

The /quoted_wares.json endpoint allows for faceted searching. Use the facets property in the response object to query and refine quoted ware results. For details on using the facets property and creating faceted query strings, refer to Wares Faceted Search.

Query Parameters

Parameter Default Description
page 1 When there are more results than can fit on a single page, you can retrieve different pages by changing this parameter.
per_page 25 You can change the number of results returned per request by changing this parameter.
sort_by nil (relevance) You can change the order in which results are returned. This orders the entire result set, not just the current page.
sort_order 1 Change the direction of the result set.
facets nil You can refine the result set by specifying facet values. See Wares Faceted Search for more information.

A Quoted Ware

Each quoted ware is indexed uniquely by the id found in the response object returned by the /quoted_ware.json endpoint. Use id to request a specific quoted ware. The server responds with the quoted ware object.

quoted_ware = AssayDepot::QuotedWare.get( 9 )
quoted_ware[AssayDepot::QuotedWare.ref_name]["id"]
=> 9
curl "http://app.scientist.com/api/v2/quoted_ware/9.json"
  -H "Authorization: Bearer [bearer_token]"
api.quoted_ware.get( 9 ).then(({quoted_ware}) => {
    console.log(quoted_ware.id)
    // => 9
});

The above command returns JSON structured like this:

{
    "query_time": 0.005106,
    "quoted_ware": {
        "id": 9,
        "_id": 9,
        "quote_group_id": 5,
        "name": "Test QuoteGroup",
        "state": "Internal Review",
        "placed_at": null,
        "permissions": ["depot"],
        "unspsc": "85131703",
        "ware_id": 5,
        "assignees": [],
        "created_at": "2019-11-14T18:42:42.566Z",
        "updated_at": "2019-11-14T18:42:42.566Z",
        "user_ref": {
            "first_name": "Kelvin",
            "last_name": "Kessler",
            "email": "kelvin6@scientist.com",
            "title": null,
            "company": "Assay Depot",
            "site": null,
            "discipline": null,
            "id": null
        },
        "provider_address": {
            "id": 20,
            "organization_name": "org name",
            "street": "864 Johnston Extension",
            "street2": null,
            "city": "Carletonland",
            "state": "UT",
            "zipcode": "46594-2178",
            "country": "LK",
            "latitude": null,
            "longitude": null,
            "name": "provider name",
            "attention": "attention line",
            "person_name": "person name",
            "care_of": "care of person",
            "text": "864 Johnston Extension\nCarletonland, UT, 46594-2178\nSri Lanka"
        },
        "provider_ref": {
            "slug": "metz-and-sons-15",
            "name": "Metz and Sons--15",
            "snippet": null,
            "logo": null,
            "average_rating": 0,
            "star_rating": 0,
            "origin": "depot",
            "permission": "in-network",
            "provisional": false,
            "score": 0.0,
            "tier": null,
            "locations": [],
            "headquarters_country": "LK",
            "sort_value": 0.0,
            "agreed_to_vendor_terms_at": null,
            "contract_pending": false,
            "contract_status": "Not signed up",
            "provider_annotations": [],
            "contact_emails": ["15test@example.com"],
            "representative_gsls": {},
            "signed_legal_documents": [],
            "cached_annotations": [],
            "total_requests": 0,
            "total_requests_completed": 0,
            "id": 15
        }
    }
}

This endpoint uses the identifier to retrieve the requested quoted ware.

HTTP Request

GET http://app.scientist.com/api/v2/quoted_wares/:quoted_ware_id.json

The server responds with the following if the quoted ware is not found:

{
    "message": "Quoted ware not found.",
    "code": 404
}

Quoted Ware Collections

The API allows you to fetch arrays of documents attached to Quoted Wares as well as individual documents. Available resources include Invoices, Proposals and Purchase Orders.

The quoted ware collections endpoint responds with an array of the requested object. Fetch individual documents by appending the the appropriate identifier to the endpoint.

An example request for the invoices endpoint is show below:

[{
    "id": 1,
    "identifier": "20000",
    "retail_total_price": "1495.0",
    "retail_subtotal_price": "1200.0",
    "tax_cost": "245.0",
    "shipping_cost": "50.0",
    "retail_total_price_currency": "$1,495.00",
    "retail_subtotal_price_currency": "$1,200.00",
    "tax_cost_currency": "$245.00",
    "shipping_cost_currency": "$50.00",
    "created_at": "2019-12-18T16:20:03.573Z",
    "updated_at": "2019-12-18T16:20:03.573Z",
    "quote_group_name": "Test QuoteGroup",
    "quote_group_identifier": "4F6FF4",
    "currency_unit": "$",
    "currency": "USD",
    "total": "$1,495.00",
    "amount": "$1,200.00",
    "ship_to": {
        "id": 4,
        "organization_name": "org name",
    },
    "line_items": [{
        "id": 1,
        "retail_unit_price_currency": "$300.00",
        "retail_unit_price": "300.0"
    },{
        "id": 2,
        "retail_unit_price_currency": "$300.00",
        "retail_unit_price": "300.0"
    }]
}]

HTTP Request

GET http://app.scientist.com/api/v2/quoted_wares/:quoted_ware_id/invoices.json

GET http://app.scientist.com/api/v2/quoted_wares/:quoted_ware_id/invoices/:id.json

GET http://app.scientist.com/api/v2/quoted_wares/:quoted_ware_id/proposals.json

GET http://app.scientist.com/api/v2/quoted_wares/:quoted_ware_id/proposals/:id.json

GET http://app.scientist.com/api/v2/quoted_wares/:quoted_ware_id/purchase_orders.json

GET http://app.scientist.com/api/v2/quoted_wares/:quoted_ware_id/purchase_orders/:id.json

The server responds with an empty array if there are no entries for the quoted ware.

[]

A Collection Entry

The API allows you to request specific entries for Invoices, Proposals and Purchase Orders.

Get a specific entry by constructing an endpoint with a quoted_ware_id, and the member label ("invoices" or "purchase_orders"), and the associated member id to get a single json response object.

my_message = AssayDepot::QuotedWareMessage.get( 9, 1 )
curl "http://app.scientist.com/api/v2/quoted_ware/9/messages/1.json"
  -H "Authorization: Bearer [bearer_token]"
api.quoted_ware_message.get( 9, 1 ).then(({message}) => {
    // do something
});

The above command returns JSON structured like this:

{
    "id": 1,
    "identifier": "20000",
    "retail_total_price": "1495.0",
    "retail_subtotal_price": "1200.0",
    "tax_cost": "245.0",
    "shipping_cost": "50.0",
    "retail_total_price_currency": "$1,495.00",
    "retail_subtotal_price_currency": "$1,200.00",
    "tax_cost_currency": "$245.00",
    "shipping_cost_currency": "$50.00",
    "created_at": "2019-12-18T16:20:03.573Z",
    "updated_at": "2019-12-18T16:20:03.573Z",
    "quote_group_name": "Test QuoteGroup",
    "quote_group_identifier": "4F6FF4",
    "currency_unit": "$",
    "currency": "USD",
    "total": "$1,495.00",
    "amount": "$1,200.00",
    "ship_to": {
        "id": 4,
        "organization_name": "org name",
        "street": "7840 Ervin Islands",
        "street2": null,
        "city": "East Hankstad",
        "state": "CT",
        "zipcode": "84788-1055",
        "country": "PK",
        "latitude": null,
        "longitude": null,
        "name": "provider name",
        "attention": "attention line",
        "person_name": "person name",
        "care_of": "care of person",
        "text": "7840 Ervin Islands\nEast Hankstad, CT, 84788-1055\nPakistan"
    },
    "line_items": [
        {
            "id": 1,
            "retail_unit_price_currency": "$300.00",
            "retail_unit_price": "300.0",
            "retail_subtotal_price_currency": "$600.00",
            "retail_subtotal_price": "600.0",
            "quantity": "2.0",
            "currency": "USD",
            "currency_unit": "$",
            "name": "CRISPR",
            "subtotal": "$600.00",
            "unit_price": "$300.00"
        },
        {
            "id": 2,
            "retail_unit_price_currency": "$300.00",
            "retail_unit_price": "300.0",
            "retail_subtotal_price_currency": "$600.00",
            "retail_subtotal_price": "600.0",
            "quantity": "2.0",
            "currency": "USD",
            "currency_unit": "$",
            "name": "CRISPR",
            "subtotal": "$600.00",
            "unit_price": "$300.00"
        }
    ]
}```

*HTTP Request*

`GET http://app.scientist.com/api/v2/quoted_wares/:quoted_ware_id/invoices/:id.json`

`GET http://app.scientist.com/api/v2/quoted_wares/:quoted_ware_id/proposals/:id.json`

`GET http://app.scientist.com/api/v2/quoted_wares/:quoted_ware_id/purchase_orders/:id.json`

> The server responds with status code `404` and a message if the entity is not found associated to the requested quoted ware:

```json
{
    "message": "Invoice order not found.",
    "code": 404
}

Invoices

Refer to Quote Ware Collections

Proposals

Refer to Quote Ware Collections

Purchase Orders

Refer to Quote Ware Collections

Attachments

The API allows you to fetch associated documents attached to Quoted Wares including Messages, and Payment Documents. Attachment objects can only be requested in their entirety. There is no means of requesting them using an id.

A GET request to any endpoint with the quoted ware identifier returns the list of attached items associated with the quoted ware.

my_messages = AssayDepot::QuotedWareMessage.get( 9 )
curl "http://app.scientist.com/api/v2/quoted_ware/9/messages.json"
  -H "Authorization: Bearer [bearer_token]"
api.quoted_ware_message.get( 9 ).then(({messages}) => {
    // do something
});

The above command returns JSON structured like this:

{
    "supplier_name": "Grimes Group--4",
    "message_count": 0,
    "quote_group_identifier": "B8A3ED",
    "older_messages_count": null,
    "all_messages": []
}

HTTP Request

GET http://app.scientist.com/api/v2/quoted_wares/:quoted_ware_id/messages.json

GET http://app.scientist.com/api/v2/quoted_wares/:quoted_ware_id/payment_documents.json

The server responds with status code 404 and a message if the entity is not found attached to the requested quoted ware:

{
    "message": "You are not authorized to view that request, please contact the site rep or requestor to be added as a follower.",
    "code": 404
}```


Compliance Manifests

Compliance manifests refer to approval documents associated with requests, proposals, and purchases.

Requestors complete manifest questionaires based on the policies for specific marketplaces. Approvers receive notifications from the marketplace alerting them to pending compliance manifest approvals.

Approvers can elect to Approve, Deny, Delegate, or Cancel a request for approval.

Manifest Index

The /compliance_manifests.json endpoint responds with a response json with a the first page of compliance manifest documents and a hash containing key/values used for searching compliance manifests based on end user criteria.

The response includes two json properties compliance_manifest_refs and facets. The former is an array of documents you can use to populate your table. The response property facets contains a structured json of search criteria related to the remaining documents available, based on the current value of the search.

curl "http://app.scientist.com/api/v2/complienace_manifests.json"
  -H "Authorization: Bearer [bearer_token]"
});

The above command returns JSON structured like this:

{
  "compliance_manifest_refs": [{
    "uuid": "96955741-f2dc-46d4-b8bc-1bded39746d7",
    "quote_group_identifier": "59E86A",
    "quote_group_name": "Test QuoteGroup",
    "type": "Unknown",
    "status": "Not Submitted",
    "reopenable": true,
    "quoted_ware_id": null,
    "proposal_id": null,
    "purchase_order_id": null,
    "standing_purchase_order_id": null,
    "invoice_id": null,
    "user_certified": false,
    "site": null,
    "legal_obligations": [],
    "approver_callback_urls": [],
    "submitted_by": null,
    "submitted_at": null,
    "cancelled_at": null,
    "obsoleted_at": null,
    "created_at": "2021-06-01T18:39:39.224Z",
    "updated_at": "2021-06-01T18:39:39.224Z"
  }],
  "facets": {
    "manifest_type": {
      "buckets": [{
        "key": "Unknown",
        "doc_count": 1
      }]
    },
    "approval_emails": {
      "buckets": [{
        "key": "davion2@scientist.com",
        "doc_count": 1
      }, {
        "key": "davion3@scientist.com",
        "doc_count": 1
      }, {
        "key": "davion4@scientist.com",
        "doc_count": 1
      }, {
        "key": "davion5@scientist.com",
        "doc_count": 1
      }, {
        "key": "davion6@scientist.com",
        "doc_count": 1
      }, {
        "key": "davion7@scientist.com",
        "doc_count": 1
      }]
    },
    "status": {
      "buckets": [{
        "key": "Not Submitted",
        "doc_count": 1
      }]
    }
  },
  "ok": true
}

This endpoint retrieves all compliance manifests visible to the requestor.

HTTP Request

GET http://app.scientist.com/api/v2/compliance_manifests.json

Query Parameters

Parameter Default Description
page 1 When there are more results than can fit on a single page, you can retrieve different pages by changing this parameter.
per_page 25 You can change the number of results returned per request by changing this parameter.
sort_by nil (relevance) You can change the order in which results are returned. This orders the entire result set, not just the current page.
sort_order 1 Change the direction of the result set.
facets nil You can refine the result set by specifying facet values.

The facets hash is keyed by the primary search property, for example manifest_type or status. The presence or absence of search properties is dependent on the data. For that reason the client UX should not rely on the presence or absence of any particular facet name. Rather, the UX should be dynamic based on the available facets.

Search by Facet

For instance, if you wanted to find status="Not Submitted", you would use the following query string:

?facets[status][]=Not Submitted

Its possible to search by multiple facets, for example:

?facets[status][]=Not Submitted&facets[approval_emails][]=davion7@scientist.com

The endpoint has no knowledge of the current state of the application so each search iteration should include all facet name/value pairs used to generate previous responses.

At present, the API is limited to one value per facet name.

A Specific Compliance Manifest

Use the uuid associated with a specific compliance manifest document to retrieve a detailed json response.

The response json will include details of the associated request or quote_group, additional approval documents approval_refs as well as details for associated proposal and purchase_order objects.

curl "http://app.scientist.com/api/v2/compliance_manifests/96955741-f2dc-46d4-b8bc-1bded39746d7.json"
  -H "Authorization: Bearer [bearer_token]"

The above command returns JSON structured like this:

{
  "ok": true,
  "compliance_manifest": {
    "uuid": "54002391-a8c4-4f7c-bfd3-8832ea03bbeb",
    "quote_group_identifier": "8F167E",
    "quote_group_name": "Test QuoteGroup",
    "type": "Unknown",
    "status": "Not Submitted",
    "reopenable": true,
    "quoted_ware_id": null,
    "proposal_id": null,
    "purchase_order_id": null,
    "standing_purchase_order_id": null,
    "invoice_id": null,
    "user_certified": false,
    "site": null,
    "legal_obligations": [],
    "approver_callback_urls": [],
    "submitted_by": null,
    "submitted_at": null,
    "cancelled_at": null,
    "obsoleted_at": null,
    "created_at": "2021-06-01T19:25:27.011Z",
    "updated_at": "2021-06-01T19:25:27.011Z",
    "approval_refs": [{
      "compliance_manifest_id": null,
      "approval_reason": null,
      "approval_markdown": null,
      "status": "Pending",
      "status_reason": "Approval created",
      "status_changed_at": "2021-06-01T19:25:06.718Z",
      "status_changed_by_id": null,
      "created_at": "2021-06-01T19:25:27.059Z",
      "updated_at": "2021-06-01T19:25:27.059Z",
      "uuid": "7616e934-a1f0-4273-82a3-ec95fab7b553",
      "approvable_id": 4
    }, {
      "compliance_manifest_id": null,
      "approval_reason": null,
      "approval_markdown": null,
      "status": "Pending",
      "status_reason": "Approval created",
      "status_changed_at": "2021-06-01T19:25:06.718Z",
      "status_changed_by_id": null,
      "created_at": "2021-06-01T19:25:28.122Z",
      "updated_at": "2021-06-01T19:25:28.122Z",
      "uuid": "24107c08-d923-44fd-931e-f2cdc305023a",
      "approvable_id": 4
    }, {
      "compliance_manifest_id": null,
      "approval_reason": null,
      "approval_markdown": null,
      "status": "Pending",
      "status_reason": "Approval created",
      "status_changed_at": "2021-06-01T19:25:06.718Z",
      "status_changed_by_id": null,
      "created_at": "2021-06-01T19:25:29.336Z",
      "updated_at": "2021-06-01T19:25:29.336Z",
      "uuid": "b3536600-f23c-4a4b-97aa-1371fc6de7c5",
      "approvable_id": 4
    }],
    "quote_group": {
      "id": 4,
      "_id": 4,
      "identifier": "8F167E",
      "followers": [],
      "assignees": [],
      "customer_accounting_email": null,
      "beacon_ids": [],
      "acceptable_currencies": [],
      "client_id": null,
      "organization_id": 7,
      "organization_uuid": "f0182fe2-760f-46f2-9769-59578aa96194",
      "site": null,
      "therapeutic_area": null,
      "promo_code": null,
      "name": "Test QuoteGroup",
      "description": "<p>Pants</p>",
      "data": {},
      "dynamic_forms": [],
      "consolidated_billing": false,
      "manager_purchase_only": false,
      "scanned_signature_required": false,
      "providers_visible": null,
      "purchase_more": null,
      "state": "Internal Review",
      "closed": false,
      "cancelled": false,
      "on_hold": false,
      "status": "Internal Review",
      "billing_same_as_shipping": false,
      "ordered_at": null,
      "placed_at": null,
      "exclude_from_reporting": false,
      "reason_for_cancelling": null,
      "proposed_deadline": null,
      "updated_at": "2021-06-01T19:25:26.601Z",
      "created_at": "2021-06-01T19:25:26.601Z",
      "user": {
        "first_name": "Frank",
        "last_name": "Leannon",
        "email": "frank15@scientist.com",
        "title": null,
        "company": "Assay Depot",
        "site": null,
        "discipline": null,
        "providers": [],
        "id": 25
      },
      "shipping_address": {
        "id": 27,
        "organization_name": "org name",
        "street": "916 Tillman Stream",
        "street2": null,
        "city": "Handside",
        "state": "MT",
        "zipcode": "47091-7696",
        "country": "TL",
        "latitude": null,
        "longitude": null,
        "name": "provider name",
        "attention": "attention line",
        "person_name": "person name",
        "care_of": "care of person",
        "text": "916 Tillman Stream\\nHandside, MT, 47091-7696\\nEast Timor"
      },
      "ware_ref": {
        "id": 4,
        "slug": "transfection-rna-assay",
        "name": "Transfection RNA Assay",
        "type": "CustomService",
        "snippet": "Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. There's a voice that keeps on calling me. Soaring through all the galaxies in search of Earth flying in to the night. Hey there where ya goin, not exactly knowin'. \\n\\n",
        "html_snippet": "<p>Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. There&#8217;s a voice that keeps on calling me. Soaring through all the galaxies in search of Earth flying in to the night. Hey there where ya goin, not exactly knowin&#8217;.</p>",
        "providers": [],
        "urls": {
          "storefront": "https://app.scientist.com/wares/transfection-rna-assay/quote_groups/new",
          "backoffice": "https://backoffice-staging.scientist.com/wares/transfection-rna-assay/edit"
        }
      }
    }
  }
}

HTTP Request

GET http://app.scientist.com/api/v2/compliance_manifests/:uuid.json

Approvals

Use the /approvals endpoint(s) to get the list of approvals associated with a compliance manifest and to perform actions on them. Actions include: approve, deny, delegate, and cancel.

Important: Approval actions change the status of requests and their approvals associated search facets. One an approval (or denial) is committed, the client will have to make a request to the /compliamce_manifest.json endpoint to refresh the search facets associated with the organization.

Approvals Index

Use the compliance_manifests/:uuid/approvals.json endpoint to fetch the approval_refs associated with a compliance manifest document. This endpoint is an alternative to the /compliance_manifest/:uuid.json endpoint returning the same approval_refs without the additional compliance manifest document detail.

curl "http://app.scientist.com/api/v2/compliance_manifests/96955741-f2dc-46d4-b8bc-1bded39746d7/approvals.json"
  -H "Authorization: Bearer [bearer_token]"

Approve

Approve requests by PUTing to the approve.json endpoint with the :uuid for both the compliance manifest and the approval document. Include a json body document with an approval property containing an object with a reason property describing why the request is approved.

curl -X PUT "http://app.scientist.com/api/v2/compliance_manifests/96955741-f2dc-46d4-b8bc-1bded39746d7/24107c08-d923-44fd-931e-f2cdc305023a/approve.json"
  -H "Authorization: Bearer [bearer_token]" -d'{"approval": {"reason": "some reason"}}'

The above command returns JSON structured like this:

{
  approval_ref: [...array of approval documents],
  note_ref: {...note reference object}
}

See Compliance Manifest Search for details on the facets hash.

Deny

Deny requests by PUTing to the deny.json endpoint with the :uuid for both the compliance manifest and the approval document. Include a json body document with an approval property containing an object with a reason property describing why the request is denied.

curl -X PUT "http://app.scientist.com/api/v2/compliance_manifests/96955741-f2dc-46d4-b8bc-1bded39746d7/24107c08-d923-44fd-931e-f2cdc305023a/deny.json"
  -H "Authorization: Bearer [bearer_token]" -d'{"approval": {"reason": "some reason why"}}'

The above command returns JSON structured like this:

{
  approval_ref: [...array of approval documents],
  note_ref: {...note reference object}
}

See Compliance Manifest Search for details on the facets hash.

Delegate

Delegate request approvals to another eligible approver for the current marketplace by PUTing to the delegate.json endpoint with the :uuid for both the compliance manifest and the approval document. Include a json body document with an approval property containing an object with an reassign_approval_to property containing an array of email strings.

The endpoint will filter any reassigned emails lacking privilege to complete the approval.

curl -X PUT "http://app.scientist.com/api/v2/compliance_manifests/96955741-f2dc-46d4-b8bc-1bded39746d7/24107c08-d923-44fd-931e-f2cdc305023a/delegate.json"
  -H "Authorization: Bearer [bearer_token]" -d'{"approval": {"reassign_approval_to": ["someone@email.com"]}}'

The above command returns JSON structured like this:

{
  approval_ref: [...array of approval documents],
  note_ref: {...note reference object}
}

See Compliance Manifest Search for details on the facets hash.

Undo

The '/undo.json` endpoint resets an approval to its original state before the approval was either Denied or Approved. As such this endpoint has no effect on an approval in its initial state.

curl -X PUT "http://app.scientist.com/api/v2/compliance_manifests/96955741-f2dc-46d4-b8bc-1bded39746d7/24107c08-d923-44fd-931e-f2cdc305023a/cancel.json"
  -H "Authorization: Bearer [bearer_token]"

The above command returns JSON structured like this:

{
  approval_ref: [...array of approval documents]
}

See Compliance Manifest Search for details on the facets hash.

Webhooks

Webhooks provide a way for application developers to register http request callbacks and implement their own business logic for marketplace events. Examples of webhook events and associated webhook actions are:

For a complete list of webhook events, see Marketplace Events

Webhooks can be registered for specific events or all events. Once a webhook is registered, whenever an event occurs, the marketplace engine will POST to the supplied URL with a payload describing the Quoted Ware in the case of a Provider webhook, or a Quote Group in the case of a Client webhook.

Create a Webhook

Create a webhook by PUTing to the /webhook_config.json endpoint. The server responds with a json object keyed by results containing the results of the operation.

This endpoint creates the webhook if it doesn't exist, or updates its configuration if its existing.

HTTP Request

PUT http://app.scientist.com/api/v2/webhook_config.json

response = AssayDepot::Webhook.put({
      "name": "My hook3.",
      "url": "https://app.client.com/my_callback1",
      "params": {"key":"value}"},
      "something_else": "should be igored.",
      "events": {"all_events": true}
 })
response["result"]
curl -X PUT "http://app.scientist.com/api/v2/webhook_config.json"
  -H "Authorization: Bearer [bearer_token]" -d"{\
      "name": "My hook2.",\
      "url": "https://app.client.com/my_callback1",\
      "params": {"key":"value}"},\
      "something_else": "should be igored.",\
      "events": {"all_events": true}}"
api.web_hook.put({
      "name": "My hook2.",
      "url": "https://app.client.com/my_callback1",
      "params": {"key":"value}"},
      "something_else": "should be igored.",
      "events": {"all_events": true}
 }).then(({response}) => {
    console.log(response.result);
});

Server response from the above PUT request:

{
    "results": {
        "name": "Applied",
        "url": "Applied",
        "params": "Applied",
        "events": "Applied",
        "something_else": "Ignored"
    },
    "query_time": 0.011215
}

Webhook Configuration

The webhooks PUT accepts the following parameters:

Parameter Type Description
name string User defined name for the web hook.
url string URL callback accepting a POST request from the marketplace server.
content_type string Content type for the callback (default: "application/json").
active boolean Status of this webhook. If false then hook will not execute (default: true).
all_events boolean Triggers webhook callback on ANY event when true (default: true).
params json object Parameters to include in the body when the callback occurs.
events json object A hash of boolean key/values to configure webhooks only on specific events.

Developers configuring webhooks must implement the corresponding POST request in their host system.

Marketplace Events

Eligible webhook events depend on the user status on the marketplace for the associated Authorization Code. Webhooks can be configured to trigger for ANY event or specific events.

Grouped by Event Category

The table below shows the events eligible for triggering webhooks grouped by the related user type on the marketplace.

Available event tags

[
    'added_as_follower',
    'amendment_submitted',
    'approval_requested',
    'cancelled_request',
    'complete',
    'compliance_manifest_approved_by',
    'compliance_submitted',
    'estimate_submitted',
    'internal_timeline_post_added',
    'invoice_submitted',
    'legal_documents_challenged',
    'legal_documents_updated',
    'new_request',
    'po_obsoleted',
    'proposal_compliance_approved',
    'proposal_compliance_denied',
    'request_compliance_approved',
    'request_compliance_required',
    'request_sent_to_vendors',
    'request_updated_proposal',
    'resumed',
    'rfi_badged',
    'rfi_submitted',
    'signature_requested',
    'signature_voided',
    'signing_complete',
    'sow_accepted',
    'sow_accepted_for_external_purchase',
    'sow_requested',
    'sow_submitted',
    'supplier_added',
    'supplier_approval_required',
    'timeline_post_added',
    'unapproved_for_payment',
    'user_legal_obligation_changed',
    'wip_timeline_post_added',
    'work_started'
]
Event Category Event Tag
approver approval_requested
compliance_manifest_approved_by
user_legal_obligation_changed
customer added_as_follower
amendment_submitted
approval_requested
cancelled_request
complete
compliance_manifest_approved_by
compliance_submitted
estimate_submitted
invoice_submitted
proposal_compliance_approved
proposal_compliance_denied
request_compliance_required
resumed
signature_requested
signature_voided
signing_complete
sow_accepted_for_external_purchase
sow_accepted
sow_submitted
timeline_post_added
unapproved_for_payment
internal_timeline_post_added
wip_timeline_post_added
user_legal_obligation_changed
work_started
customer_follower added_as_follower
amendment_submitted
approval_requested
cancelled_request
complete
compliance_manifest_approved_by
compliance_submitted
estimate_submitted
proposal_compliance_approved
proposal_compliance_denied
request_compliance_required
resumed
signature_requested
signature_voided
signing_complete
sow_accepted_for_external_purchase
sow_accepted
sow_submitted
timeline_post_added
internal_timeline_post_added
wip_timeline_post_added
user_legal_obligation_changed
work_started
site_rep amendment_submitted
cancelled_request
complete
compliance_manifest_approved_by
estimate_submitted
legal_documents_challenged
new_request
proposal_compliance_approved
proposal_compliance_denied
request_compliance_approved
request_updated_proposal
request_sent_to_vendors
resumed
rfi_badged
signature_requested
signature_voided
signing_complete
sow_accepted_for_external_purchase
sow_accepted
sow_requested
sow_submitted
supplier_added
timeline_post_added
internal_timeline_post_added
wip_timeline_post_added
user_legal_obligation_changed
work_started
vendor added_as_follower
cancelled_request
legal_documents_updated
new_request
po_obsoleted
request_updated_proposal
rfi_submitted
signature_requested
signature_voided
sow_requested
supplier_approval_required
timeline_post_added
work_started
vendor_follower added_as_follower
cancelled_request
legal_documents_updated
new_request
po_obsoleted
request_updated_proposal
rfi_submitted
signature_requested
signature_voided
sow_requested
supplier_approval_required
timeline_post_added
work_started

Webhook Data

The client application must accept a POST to its configured URL. The body of the post request includes information about the associated Quote Group/Quoted Ware. A prototype of the post body is shown in the code pane to the right/below:

Depending on the user and corresponding event, the POST body provided by the webhook may contain some or all of the following properties:

{
    email: "email",
    subject: "subject string",
    subdomain: "subdomain",
    url: "url",
    quote_group_description_html: "html_description",
    quote_group_description_text: "description",
    compliance_type: "type",
    identifier: "identifier",
    vendor_identifier: "vendor_identifier",
    quote_group_id: "quote_group_id",
    quoted_ware_id: "quoted_ware_id",
    provider_rfi_annotation_status: "status",
    provider_rfi_annotation_badge_type: "badge_type",
    proposal_id: "proposal_id",
    purchase_order_id: "purchase_order_id",
    compliance_manifest_id: "compliance_manifest_id",
    multipage_form_id: "multipage_form_id",
    multipage_form_name: "multipage_form_name",
    multipage_form_expires_on: "multipage_form_expires_on",
    approval_id: "approval_id",
    note_id: "note_id",
    provider_id: "provider_id",
    provider_name: "provider_name",
    title: "title",
    action_performed: "action_performed",
    action_performed_human: "action_performed_human",
    marketplace: "marketplace",
    html_description: "html_description",
    text_description: "text_description",
    body: "string reason for cancelling or other attachments",
    template_name: "email_template",
    attachments: "attached_pdfs"
}

Update a Webhook

Updating and creating use the same endpoint, method, and parameters. Refer to Create a Webhook for details.

Delete a Webhook

To remove a webhook issue a DELETE request to the /webhook_config.json endpoint.

HTTP Request

DELETE http://app.scientist.com/api/v2/webhook_config.json

response = AssayDepot::Webhook.delete()
response["status"]
=> "ok"
curl -X DELETE "http://app.scientist.com/api/v2/webhook_config_.json"
  -H "Authorization: Bearer [bearer_token]"
api.web_hook.delete().then(({response}) => {
    console.log(response.status);
    // "ok"
});

Server response from the above PUT request:

{
  "status": "ok"
}

Action Items

Action Items are documents that provide a trace back of the events unfolding for a quote group and its associated quoted wares and notes.

By way of example, if a supplier submits an SOW (Statement Of Work), the marketplace expects the next action is the user will accept that sow. The action item for the submitting SOW user is updated to reflect, action_performed: "sow_submitted", and a new action next_action: "accept_sow" get created. The new action includes a generated link to the page where the requesting user can actually accept the SOW. Subsequent action items can trigger webhooks (including email notices and push notifications), as well as populating the digest emails.

This endpoint retrieves all action items attached to the user account defined by the access token.

HTTP Request

GET http://app.scientist.com/api/v2/dynamic_form/:form_id.json

Dynamic Forms

Dynamic forms are used by the platform to customize supplier dialogs for requesting goods and services and for informing compliance. Suppliers also use dynamic forms for building responses to requests for quote.

The API has limited functions in relation to dynamic forms. However, dynamic forms are data-driven therefore the API provides some means for reading dynamic forms data from the database for rendering on mobile devices and for archival purposes.

A Dynamic Form

form = AssayDepot::DynamicForm.get( 1 )
curl "http://app.scientist.com/api/v2/dynamic_forms/1.json"
  -H "Authorization: Bearer [bearer_token]"
api.dynamic_form.get( 1 ).then(({form}) => {
    // do something
});

The above command returns JSON structured like this:

{
    "id": 1,
    "name": "A 1 long \u0026 complicated Name",
    "version_number": 1,
    "slug": "dynamic_slug",
    "default_renderer": "html code",
    "javascript": "javascript code",
    "stylesheet": "css code",
    "snippet": "This is *radical*, indeed.",
    "parent_id": null,
    "schema": {
        "type": "object",
        "properties": {}
    },
    "options": {
        "hideInitValidationError": false,
        "fields": {}
    },
    "data": {},
    "created_at": "2019-11-18T18:45:36.421Z",
    "updated_at": "2019-11-18T18:45:36.421Z",
    "couch_id": null,
    "origin": "depot",
    "access": ["depot"],
    "backoffice_renderer": null,
    "columns": []
}

This endpoint retrieves a specific form by its identifier.

HTTP Request

GET http://app.scientist.com/api/v2/dynamic_form/:form_id.json

Dynamic Lists

Use Dynamic Lists to align internal systems with the marketplace.

Dynamic Lists provide a means to support custom lists in the platform. Companies with list of things that they want users to select from during compliance (or whatever step in the system) can use Dynamic Lists to implement these rules. For example, a company requiring a cost center pick list in its request form can maintain the pick list using Dynamic Lists. When cost center data changes, these changes can be posted dynamically with no human intervention in the change.

The connection to Dynamic Forms is described here....

Dynamic Lists

form = AssayDepot::DynamicList.get()
curl "http://app.scientist.com/api/v2/dynamic_lists.json"
  -H "Authorization: Bearer [bearer_token]"
api.dynamic_list.get().then(({form}) => {
    // do something
});

The above command returns JSON structured like this:

{
  "dynamic_lists": [
    {
      "name": "xyz",
      "slug": "xyz4"
    }
  ],
  "query_time": 0.197714
}

A Dynamic List

form = AssayDepot::DynamicList.get()
curl "http://app.scientist.com/api/v2/dynamic_lists/:slug.json"
  -H "Authorization: Bearer [bearer_token]"
api.dynamic_list.get().then(({form}) => {
    // do something
});

The above command returns JSON structured like this:

{
  "dynamic_list": {
    "name": "xyz",
    "slug": "xyz4"
  },
  "query_time": 0.047721
}

Create A Dynamic List

form = AssayDepot::DynamicList.post( post_body )
curl "http://app.scientist.com/api/v2/dynamic_lists/:slug.json"
  -H "Authorization: Bearer [bearer_token]"
api.dynamic_list.get().then(({form}) => {
    // do something
});

Post body:

{
  "items": [
    {
      "value": "a",
      "human_readable_value": "A"
    },
    {
      "value": "b",
      "human_readable_value": "B"
    },
    {
      "value": "c",
      "human_readable_value": "C"
    }
  ]
}

The above command returns JSON structured like this:

{"status":"ok","removed":0,"added":3,"query_time":0.138145}

This endpoint retrieves a specific form by its identifier.

HTTP Request

GET http://app.scientist.com/api/v2/dynamic_form/:form_id.json

Organizations

Whereas Providers refer to suppliers of goods and survices on the marketplace, Organizations represent client organizations who request and purchase goods and services.

Access to organizations records on the marketplace is scoped to the requesting users' administrative domain. A non-administrative user can only access their default or current record using the /organizations/default.json or /organizations/current.json endpoints.

All Organizations

users = AssayDepot::Organization.get()
curl "http://app.scientist.com/api/v2/organizations.json"
  -H "Authorization: Bearer [bearer_token]"
api.organization.get().then(({organization}) => {
    // do something
});

The above command returns JSON structured like this:

[
    {
        "id": 4,
        "uuid": "98470754-d263-456f-9361-81fa309699ea",
        "name": "Swalife Biotech",
        "subdomain": "dev",
        "domain": "scientist.com",
        "tag_line": "Outsource everything but the genius&trade;",
        "standard-logo": "https://rx-organization-assets-development-eu-central-1.s3.amazonaws.com/logos/98470754-d263-456f-9361-81fa309699ea/standard-logo?1572364134",
        "square-logo": "https://rx-organization-assets-development-eu-central-1.s3.amazonaws.com/logos/98470754-d263-456f-9361-81fa309699ea/square-logo?1572364134",
        "url": "http://rx.lvh.me:3000"
    },
    {
        "id": 5,
        "uuid": "86b762c9-3453-4896-977d-09c4e8cca3ef",
        "name": "Y B chavan pharmacy college ",
        "subdomain": "app",
        "domain": "scientist.com",
        "tag_line": "Outsource everything but the genius&trade;",
        "standard-logo": "https://rx-organization-assets-development-eu-central-1.s3.amazonaws.com/logos/86b762c9-3453-4896-977d-09c4e8cca3ef/standard-logo?1572364134",
        "square-logo": "https://rx-organization-assets-development-eu-central-1.s3.amazonaws.com/logos/86b762c9-3453-4896-977d-09c4e8cca3ef/square-logo?1572364134",
        "url": "http://rx.lvh.me:3000"
    }
]

This endpoint retrieves all organizations.

HTTP Request

GET http://app.scientist.com/api/v2/organizations.json

Get Default Organization

users = AssayDepot::Organization.get('default')
curl "http://app.scientist.com/api/v2/organizations/default.json"
  -H "Authorization: Bearer [bearer_token]"
api.organization.get('default').then(({organization}) => {
    // do something
});

The above command returns JSON structured like this:

{
    "id": 4,
    "uuid": "98470754-d263-456f-9361-81fa309699ea",
    "name": "Swalife Biotech",
    "subdomain": "dev",
    "domain": "scientist.com",
    "tag_line": "Outsource everything but the genius&trade;",
    "standard-logo": "https://rx-organization-assets-development-eu-central-1.s3.amazonaws.com/logos/98470754-d263-456f-9361-81fa309699ea/standard-logo?1572364564",
    "square-logo": "https://rx-organization-assets-development-eu-central-1.s3.amazonaws.com/logos/98470754-d263-456f-9361-81fa309699ea/square-logo?1572364564",
    "url": "http://rx.lvh.me:3000"
}

This endpoint retrieves the "default" organization.

HTTP Request

GET http://app.scientist.com/api/v2/organizations/default.json

Current Organization

users = AssayDepot::Organization.get('current')
curl "http://app.scientist.com/api/v2/organizations/current.json"
  -H "Authorization: Bearer [bearer_token]"
api.organization.get('current').then(({organization}) => {
    // do something
});

The above command returns JSON structured like this:

{
    "id": 4,
    "uuid": "98470754-d263-456f-9361-81fa309699ea",
    "name": "Swalife Biotech",
    "subdomain": "dev",
    "domain": "scientist.com",
    "tag_line": "Outsource everything but the genius&trade;",
    "standard-logo": "https://rx-organization-assets-development-eu-central-1.s3.amazonaws.com/logos/98470754-d263-456f-9361-81fa309699ea/standard-logo?1572364653",
    "square-logo": "https://rx-organization-assets-development-eu-central-1.s3.amazonaws.com/logos/98470754-d263-456f-9361-81fa309699ea/square-logo?1572364653",
    "url": "http://rx.lvh.me:3000"
}

This endpoint retrieves the "current" organization.

HTTP Request

GET http://app.scientist.com/api/v2/organizations/current.json

Users

Users can be members of a Provider or Organization on the marketplace.

Access to user records on the marketplace is scoped to the requesting users' administrative domain. A non-administrative user can only access his/her own user record. Administrators of a domain can download all user records for that domain.

Users

Request details of the user account scoped to your authorization code with /users/profile.json. The server responds with an object keyed by "user". A request to /users.json returns an object with an array of users found at user_refs and a facets object keyed by the search terms available to query for specific users.

users = AssayDepot::User.get()
curl "http://app.scientist.com/api/v2/users.json"
  -H "Authorization: Bearer [bearer_token]"
api.users.get().then(({users}) => {
    // do something
});

The above command returns JSON structured like this:

{
    "total": 1,
    "page": 1,
    "per_page": 25,
    "query_time": 0.165347,
    "facets": {
        "site": {
            "doc_count": 1,
            "site": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 0,
                "buckets": []
            }
        },
        "company": {
            "doc_count": 1,
            "company": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 0,
                "buckets": []
            }
        },
        "discipline": {
            "doc_count": 1,
            "discipline": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 0,
                "buckets": []
            }
        },
        "title": {
            "doc_count": 1,
            "title": {
                "doc_count_error_upper_bound": 0,
                "sum_other_doc_count": 0,
                "buckets": []
            }
        }
    },
    "user_refs": [
        {
            "first_name": "John",
            "last_name": "Smith",
            "email": "john@scientist.com",
            "title": null,
            "company": null,
            "site": null,
            "discipline": null,
            "id": 1
        }
    ]
}

HTTP Request

GET http://app.scientist.com/api/v2/users.json

Users Facet Search

Refer to the Provider Facet section for details on facet searching of User records as the facets object returned from a Users request has a similar form as the Providers search response.

Errors

The API uses the following error codes:

Error Code Meaning
401 Unauthorized -- Your authorization code is lacking permission.
403 Forbidden -- You are authorization code does not allow this operation.
404 Not Found -- The requested record could not be found.
422 Unprocessable Entity -- Something about the request could not be handled.
500 Internal Server Error -- We had a problem with our server. Try again later.