Chemwatch Web API 2.0 - Developer Guide
Check out the neww version of the Chemwatch API documentation here: https://www.chemwatch-docs.net/.
- 1 Overview
- 2 Authentication
- 3 REST
- 3.1 Service URL
- 3.2 Requests
- 3.3 Responses
- 3.4 Error Details
- 3.4.1 XML Error Sample
- 3.4.2 JSON Error Sample
- 4 Operations
- 4.1 Authentication
- 4.1.1 Method "authenticate"
- 4.1.1.1 XML Response Sample
- 4.1.1.2 JSON Response Sample
- 4.1.2 Method "auth"
- 4.1.2.1 XML Request body
- 4.1.2.2 JSON Request body
- 4.1.2.3 XML Response Sample
- 4.1.2.4 JSON Response Sample
- 4.1.3 Method: Get Countries - "countries"
- 4.1.3.1 XML Response Sample
- 4.1.3.2 JSON Response Sample
- 4.1.4 Method: Get Languages - "languages"
- 4.1.4.1 XML Response Sample
- 4.1.4.2 JSON Response Sample
- 4.1.1 Method "authenticate"
- 4.2 Search
- 4.2.1 Method: Search Materials - "materials"
- 4.2.1.1 XML Response Sample
- 4.2.2 Method: Get Own Materials - "ownmaterials"
- 4.2.2.1 XML Response Sample
- 4.2.2.2 JSON Response Sample
- 4.2.3 Method: Get CwNumbers by Cas - "cwnumbers"
- 4.2.3.1 XML Response Sample
- 4.2.3.2 JSON Response Sample
- 4.2.1 Method: Search Materials - "materials"
- 4.3 Material Data Requests
- 4.3.1 Method (GET): Get Material Data - "materialsdata"
- 4.3.1.1 XML Response Sample
- 4.3.1.2 JSON Response Sample
- 4.3.2 Method: Get material data-points - "datapoints"
- 4.3.2.1 XML Response Sample
- 4.3.2.2 JSON Response Sample
- 4.3.3 Method (GET): Get Material VGD Data - "materialsvgddata"
- 4.3.3.1 XML Response Sample
- 4.3.3.2 JSON Response Sample
- 4.3.4 Method: Search Vendors - "vendors"
- 4.3.4.1 XML Response Sample
- 4.3.4.2 JSON Response Sample
- 4.3.1 Method (GET): Get Material Data - "materialsdata"
- 4.4 Document Requests
- 4.4.1 Get Documents - method "documents"
- 4.4.1.1 XML Response Sample
- 4.4.1.2 JSON Response Sample
- 4.4.2 Get Documents by Part Number - method "GetDocumentsByPartNumber"
- 4.4.2.1 XML Response Sample
- 4.4.2.2 JSON Response Sample
- 4.4.3 Get report / document in HTML - "report"
- 4.4.3.1 XML Response Sample
- 4.4.3.2 JSON Response Sample
- 4.4.4 Get report / document in PDF - method pdfreport
- 4.4.5 Get Templates - method "templates"
- 4.4.5.1 XML Response Sample
- 4.4.5.2 JSON Response Sample
- 4.4.6 Get Vendor SDS - method document
- 4.4.1 Get Documents - method "documents"
- 4.5 Msds Request
- 4.5.1 Send Msds Request - method "MsdsRequest"
- 4.5.1.1 XML Request body
- 4.5.1.2 XML Response Sample
- 4.5.1.3 JSON Request body
- 4.5.1.4 JSON Response Sample
- 4.5.1 Send Msds Request - method "MsdsRequest"
- 4.1 Authentication
- 5 Folder Node Methods
- 6 SOAP
Overview
Chemwatch WebService API provides an easy and robust way of getting data from Chemwatch based on parameters selected in a request. It exposes a simple to use REST interface that can be implemented in any programming language capable of working with Web. It also exposes more sophisticated native .NET SOAP interface with WSDL (preferred method for .NET programming).
Chemwatch WebService API has all the required functions to do the following operations:
Search Chemicals by Name, Synonym, CAS or internal ID (Chemwatch Number: CW No)
Retrieve (M)SDS data-points on a selected chemical (Between 30 and 500 (M)SDS end-points available, depending on the type of record)
Retrieve Regulatory data-points on a selected chemical (up to 6,000 end-points available, depending on the chemical)
Retrieve documents in PDF format (one of many selected types of documents including SDS, Label(s), MINI-Reports, etc.).
Chemwatch API is the most efficient method of integrating extensive chemical data and documents into ERP systems, laboratory systems, websites, online stores, and custom software platforms with minimal effort.
Authentication
There are two ways of authenticating to use the servcies:
The recommended approach is to set up and use API secret (can be requested from it@chemwatch.net). Please note that the secret is user-dependend. All user settings will apply to the output. The header that has to be set to the secret is named "x-api-key". Simply pass it within a call to a method and the service will authenticate you automatically.
Manual handling of session cookie by calling auth() or authentication() methods. The cookie should then be passwed in subsequent calls to identify the session. This approach wil be good when you need to authenticate once and them make a big number of calls (like calls to update many documents or data sets).
REST
Service URL
Base Service URL |
---|
Note: For SOAP and WSDL please check further.
Requests
The Chemwatch Web API is based on REST principles: data resources are accessed via standard HTTP requests to an API endpoint.
All requests to the API require authentication. Authentication request, if completed successfully, provide a session cookie that should be attached to all subsequent requests (for more information see below).
Responses
All data is received as XML or JSON object.
Response HTTP Status Codes
Status Code | Description |
---|---|
200 | SUCCESS: The request has succeeded. The client can read the result of the request in the body of the response. |
400 | Bad Request. The request could not be understood by the server due to malformed syntax. The message body will contain more information. |
401 | Unauthorized - The request requires user authentication. |
429 | Limit is exceeded - |
500 | Internal Server Error. |
Error Details
Unsuccessful responses return information about the error as an XML (or JSON) object containing the following information:
Key | Value Type | Value Description |
---|---|---|
Code | integer | Error code |
Message | string | A short description of the cause/description of the error. |
EXAMPLE 1:
XML Error Sample
HTTP/1.1 401 Unauthorized
Cache-Control: private
Content-Length: 50
Content-Type: application/xml
<Error xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Code>401</Code>
<Message>User is not authenticated</Message>
</Error>
EXAMPLE 2:
JSON Error Sample
HTTP/1.1 401 Unauthorized
Cache-Control: private
Content-Length: 50
Content-Type: application/json
{
"Code":401,
"Message":"User is not authenticated"
}
Operations
Authentication
Please note that in most cases you simply need to pass a secret code via header "x-api-key". The service will authenticate the user associated with the secret for you.
Headers | |
Content-Type | application/json |
x-api-key | <secret key> |
Method "authenticate"
Used to authenticate the "User" and obtain the session cookie to be attached to all subsequent requests.
URL:
XML | GET /api/v1/authenticate |
JSON | GET /api/v1/json/authenticate |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
domain | string | yes | domain name |
login | string | yes | user login |
password | string | yes | password |
Request Sample
GET /api/v1/authenticate?domain=xxx&login=xxx&password=xxx |
All requests to the API require authentication. Authentication requests, if completed successfully, provides a session cookie that should be attached to all subsequent requests.
Response Format:
On success, the response body contains AuthResponse object in XML (JSON) format. Also the response contains cookie with a security token.
XML Response Sample
HTTP/1.1 200 OK
Content-Length: 65
Set-Cookie: Login=FB6615F554E168CE8ED0750B4E39735EE34FF7CE; expires=Sat, 11-Jul-2015 12:39:38 GMT; path=/
Content-Type: application/xml; charset=utf-8
<AuthResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Code>200</Code>
<Message>Authentication is successfully completed</Message>
</AuthResponse>
JSON Response Sample
HTTP/1.1 200 OK
Content-Length: 65
Set-Cookie: Login=FB6615F554E168CE8ED0750B4E39735EE34FF7CE; expires=Sat, 11-Jul-2015 12:39:38 GMT; path=/
Content-Type: application/json; charset=utf-8
{
"Code":200,
"Message":"Authentication is successfully completed"
}
Following codes are possible (for AuthResponse object):
Code | Message |
---|---|
200 | Authentication is successfully completed |
241 | There is no such user |
242 | Password is incorrect |
243 | User is locked |
244 | Subscription has expired |
245 | User password has expired |
Method "auth"
Used to authenticate the "User" and obtain the session cookie to be attached to all subsequent requests.
URL:
XML | POST /api/v1/auth | Http header: Content-Type: application/xml; charset=utf-8 |
JSON | POST /api/v1/json/auth | Http header: Content-Type: application/json; charset=utf-8 |
Request Sample
POST /api/v1/auth Content-Type: application/xml; charset=utf-8 |
Request body
XML Request body
<AuthRequest>
<Domain>xxx</Domain>
<Login>xxx</Login>
<Password>xxx</Password>
</AuthRequest>
Request JSON Sample
POST /api/v1/json/auth Content-Type: application/json; charset=utf-8 |
Request body
JSON Request body
{
"domain": "xxx",
"login": "xxx",
"password": "xxx"
}
All requests to the API require authentication. Authentication requests, if completed successfully, provides a session cookie that should be attached to all subsequent requests.
Response Format:
On success, the response body contains AuthResponse object in XML (JSON) format. Also the response contains cookie with a security token.
XML Response Sample
HTTP/1.1 200 OK
Content-Length: 65
Set-Cookie: Login=FB6615F554E168CE8ED0750B4E39735EE34FF7CE; expires=Sat, 11-Jul-2015 12:39:38 GMT; path=/
Content-Type: application/xml; charset=utf-8
<AuthResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Code>200</Code>
<Message>Authentication is successfully completed</Message>
</AuthResponse>
JSON Response Sample
HTTP/1.1 200 OK
Content-Length: 65
Set-Cookie: Login=FB6615F554E168CE8ED0750B4E39735EE34FF7CE; expires=Sat, 11-Jul-2015 12:39:38 GMT; path=/
Content-Type: application/json; charset=utf-8
{
"Code":200,
"Message":"Authentication is successfully completed"
}
Method: Get Countries - "countries"
Used to obtain the list of "country" parameters.
"Country" value needs to be provided with requests for Data and Documents to ensure the correct regulatory information, or, Document Format is provided.
URL:
XML | GET /api/v1/countries |
JSON | GET /api/v1/json/countries |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
msdsOnly | bool | no | If true - returns only MSDS countries |
Request Sample
GET /api/v1/countries GET /api/v1/countries?msdsOnly=true |
Response Format:
Response body contains an array of Country objects in XML (or JSON) format
XML Response Sample
<ArrayOfCountry xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Country>
<Code>ARG</Code>
<Id>81</Id>
<Name>Argentina</Name>
</Country>
...
</ArrayOfCountry>
JSON Response Sample
[
{
"Code":"ARG",
"Id":"81",
"Name":"Argentina"
},
...
]
Method: Get Languages - "languages"
Used to obtain the list of "Language" parameters.
"Language" value needs to be provided with requests for Data and Documents to ensure that the document(s) or data requested is "served" in the right language.
URL:
XML | GET /api/v1/languages |
JSON | GET /api/v1/json/languages |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
msdsOnly | bool | no | If true - returns only MSDS countries |
Request Sample
GET /api/v1/languages GET /api/v1/languages?msdsOnly=true |
Response Format:
Response body contains an array of Language objects in XML (or JSON) format
XML Response Sample
<ArrayOfLanguage xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Language>
<Code>AR</Code>
<Id>340719</Id>
<Name>Arabic</Name>
</Language>
...
</ArrayOfLanguage>
JSON Response Sample
[
{
"Code":"AR",
"Id":"340719",
"Name":"Arabic"
},
...
]
Search
Method: Search Materials - "materials"
Used to search the Chemwatch database Materials/Chemicals. Various search parameters supported.
Note: UserPartNo can be used for search.
URL:
XML | GET /api/v1/materials |
JSON | GET /api/v1/json/materials |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
name | string | no | Material name search parameter |
languageId | integer | no | Language |
cas | string | no | CAS search parameter |
cwNo | string | no | CwNumber search parameter |
gid | string | no | GID search parameter |
userPartNumber | string | no | User's Part Number parameter |
folderId | integer | no | Folder |
own | bool | no | Searched Own collection is set to true. If set to false searched in Full database. |
sortField | string | no | Sorting by field: "soursetype" - source tyoe cane be primary or secondary, "name" - default value |
sortDirection | string | no | Possible values: asc - sorting by ascending desc - sorting by descending |
pageNumber | integer | no | indicates page number |
pageSize | integer | no | indicates count of items per page |
Request Sample
GET /api/v1/materials?name=acetone&pageNumber=1&pageSize=15 |
Own search will be performed if own parameter is not specified
'Search in full DB' privilege is required if Full search is performed
Response Format:
Response body contains ListResult of Material object in XML (or JSON) format
XML Response Sample
<ListResultOfMaterial xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<PageCount>1</PageCount>
<PageNumber>1</PageNumber>
<PageSize>15</PageSize>
<RowCount>3</RowCount>
<Rows>
<Material>
<Cas>67-64-1</Cas>
<CwNo>1090</CwNo>
<Id>4200280</Id>
<IsGold>false</IsGold>
<MaterialData>
<Field>
<Name>CW</Name>
<Value>1090</Value>
</Field>
<Field>
<Name>NAME</Name>
<Value>acetone</Value>
</Field>
...
</MaterialData>
<Name>acetone</Name>
</Material>
...
</Rows>
</ListResultOfMaterial>
{
"PageCount":1,
"PageNumber":1,
"PageSize":15,
"RowCount":3,
"Rows":[
{
"Cas":"67-64-1",
"CwNo":"1090",
"Id":4200280,
"IsGold":false,
"MaterialData":[
{"Name":"CW", "Value":"1090"},
{"Name":"NAME","Value":"acetone"},
...
],
"Name":"acetone"
},
...
]
}
{
"pageCount": 2,
"rowCount": 18,
"pageNumber": 1,
"pageSize": 10,
"rows": [
{
"materialId": "4200280",
"groupId": "CW",
"vendorId": -1,
"documentType": "ms",
"countryCode": "ANY",
"languageCode": "ANY",
"issueDate": "2016-02-25T00:00:00",
"fileName": "",
"cwNumber": "1090",
"externalUrl": "http://jr.chemwatch.net/cwws/MaterialService.svc/GetMsdsByExternalUrl?mi=4200280&cn=ANY&ln=ANY&fn=&cwn=1090&ui=72190&di=17548&ts=636437314781062845&v=&hc=69FEFE23A5009E59239400E1C27E1A07",
"sourceType": "p",
"isCWGold": true,
"isWeWrite": false,
"isPrivate": false,
"isChemwatch": true,
"isAvailable": true,
"isLatest": true,
"groupName": "ChemWatch",
"docNo": "a1090",
"countryId": 0,
"languageId": 0,
"preferredVendor": "ChemWatch"
},
{
"materialId": "4897766",
"groupId": "SIGMA",
"vendorId": 4200002922,
"documentType": "ms",
"countryCode": "Netherlands",
"languageCode": "Dutch",
"issueDate": "2007-02-15T00:00:00",
"fileName": "pd6192754.txt.gz",
"cwNumber": "31257-5",
"externalUrl": "http://jr.chemwatch.net/cwws/DocumentService.svc/GetDocumentContentByExternalUrl?mi=4897766&gid=SIGMA&cn=118&ln=340711&fn=pd6192754.txt.gz&cwn=31257-5&ui=72190&di=17548&ts=636437314781218843&v=&hc=C59678AEC87755438BB856AA1F45E089",
"sourceType": "p",
"isCWGold": false,
"isWeWrite": false,
"isPrivate": false,
"isChemwatch": false,
"isAvailable": true,
"isLatest": true,
"groupName": "Sigma-Aldrich",
"docNo": "6192754",
"countryId": 118,
"languageId": 340711,
"preferredVendor": "Sigma-Aldrich (Merck)"
},
{
"materialId": "4897766",
"groupId": "SIGMA",
"vendorId": 5591,
"documentType": "ms",
"countryCode": "United States",
"languageCode": "English",
"issueDate": "2014-07-01T00:00:00",
"fileName": "pd12515147.pdf",
"cwNumber": "31257-5",
"externalUrl": "http://jr.chemwatch.net/cwws/DocumentService.svc/GetDocumentContentByExternalUrl?mi=4897766&gid=SIGMA&cn=140&ln=340700&fn=pd12515147.pdf&cwn=31257-5&ui=72190&di=17548&ts=636437314781218843&v=&hc=FC5425874B20A8B00C9BA9BE1486164D",
"sourceType": "p",
"isCWGold": false,
"isWeWrite": false,
"isPrivate": false,
"isChemwatch": false,
"isAvailable": true,
"isLatest": true,
"groupName": "Sigma-Aldrich",
"docNo": "12515147",
"countryId": 140,
"languageId": 340700,
"preferredVendor": "Sigma Aldrich (as MiliporeSigma, Merck)"
},
{
"materialId": "4897766",
"groupId": "SIGMA",
"vendorId": 5594,
"documentType": "ms",
"countryCode": "Germany",
"languageCode": "English",
"issueDate": "2012-12-04T00:00:00",
"fileName": "pd12897617.pdf",
"cwNumber": "31257-5",
"externalUrl": "http://jr.chemwatch.net/cwws/DocumentService.svc/GetDocumentContentByExternalUrl?mi=4897766&gid=SIGMA&cn=96&ln=340700&fn=pd12897617.pdf&cwn=31257-5&ui=72190&di=17548&ts=636437314781218843&v=&hc=08E8E8F2F75CA9E1169835F0074F7479",
"sourceType": "p",
"isCWGold": false,
"isWeWrite": false,
"isPrivate": false,
"isChemwatch": false,
"isAvailable": true,
"isLatest": true,
"groupName": "Sigma-Aldrich",
"docNo": "12897617",
"countryId": 96,
"languageId": 340700,
"preferredVendor": "Sigma-Aldrich (Merck)"
},
{
"materialId": "4897766",
"groupId": "SIGMA",
"vendorId": 5607,
"documentType": "ms",
"countryCode": "Australia",
"languageCode": "English",
"issueDate": "2013-04-15T00:00:00",
"fileName": "pd12685675.pdf",
"cwNumber": "31257-5",
"externalUrl": "http://jr.chemwatch.net/cwws/DocumentService.svc/GetDocumentContentByExternalUrl?mi=4897766&gid=SIGMA&cn=82&ln=340700&fn=pd12685675.pdf&cwn=31257-5&ui=72190&di=17548&ts=636437314781218843&v=&hc=E72303F2B250C12A13129AA266B43978",
"sourceType": "p",
"isCWGold": false,
"isWeWrite": false,
"isPrivate": false,
"isChemwatch": false,
"isAvailable": true,
"isLatest": true,
"groupName": "Sigma-Aldrich",
"docNo": "12685675",
"countryId": 82,
"languageId": 340700,
"preferredVendor": "Sigma-Aldrich (Merck)"
},
{
"materialId": "4897766",
"groupId": "SIGMA",
"vendorId": 30763,
"documentType": "ms",
"countryCode": "Spain",
"languageCode": "English",
"issueDate": "2012-12-04T00:00:00",
"fileName": "pd12897609.pdf",
"cwNumber": "31257-5",
"externalUrl": "http://jr.chemwatch.net/cwws/DocumentService.svc/GetDocumentContentByExternalUrl?mi=4897766&gid=SIGMA&cn=133&ln=340700&fn=pd12897609.pdf&cwn=31257-5&ui=72190&di=17548&ts=636437314781218843&v=&hc=2A425D4F47449D64C698611AECBFCAD4",
"sourceType": "p",
"isCWGold": false,
"isWeWrite": false,
"isPrivate": false,
"isChemwatch": false,
"isAvailable": true,
"isLatest": true,
"groupName": "Sigma-Aldrich",
"docNo": "12897609",
"countryId": 133,
"languageId": 340700,
"preferredVendor": "Sigma-Aldrich (Merck)"
},
{
"materialId": "4897766",
"groupId": "SIGMA",
"vendorId": 18671,
"documentType": "ms",
"countryCode": "Switzerland",
"languageCode": "English",
"issueDate": "2012-12-04T00:00:00",
"fileName": "pd12897618.pdf",
"cwNumber": "31257-5",
"externalUrl": "http://jr.chemwatch.net/cwws/DocumentService.svc/GetDocumentContentByExternalUrl?mi=4897766&gid=SIGMA&cn=135&ln=340700&fn=pd12897618.pdf&cwn=31257-5&ui=72190&di=17548&ts=636437314781218843&v=&hc=9CEA46130EF05D6F902370895420D4E3",
"sourceType": "p",
"isCWGold": false,
"isWeWrite": false,
"isPrivate": false,
"isChemwatch": false,
"isAvailable": true,
"isLatest": false,
"groupName": "Sigma-Aldrich",
"docNo": "12897618",
"countryId": 135,
"languageId": 340700,
"preferredVendor": "Sigma-Aldrich (Merck)"
},
{
"materialId": "4897766",
"groupId": "SIGMA",
"vendorId": 33777,
"documentType": "ms",
"countryCode": "Canada",
"languageCode": "English",
"issueDate": "2014-08-18T00:00:00",
"fileName": "pd12897611.pdf",
"cwNumber": "31257-5",
"externalUrl": "http://jr.chemwatch.net/cwws/DocumentService.svc/GetDocumentContentByExternalUrl?mi=4897766&gid=SIGMA&cn=86&ln=340700&fn=pd12897611.pdf&cwn=31257-5&ui=72190&di=17548&ts=636437314781218843&v=&hc=46A5014E6D9E0FFEF52238F9C6375370",
"sourceType": "p",
"isCWGold": false,
"isWeWrite": false,
"isPrivate": false,
"isChemwatch": false,
"isAvailable": true,
"isLatest": true,
"groupName": "Sigma-Aldrich",
"docNo": "12897611",
"countryId": 86,
"languageId": 340700,
"preferredVendor": "Sigma Aldrich (as MiliporeSigma, Merck)"
},
{
"materialId": "4897766",
"groupId": "SIGMA",
"vendorId": 24961,
"documentType": "ms",
"countryCode": "Italy",
"languageCode": "English",
"issueDate": "2012-12-04T00:00:00",
"fileName": "pd12897620.pdf",
"cwNumber": "31257-5",
"externalUrl": "http://jr.chemwatch.net/cwws/DocumentService.svc/GetDocumentContentByExternalUrl?mi=4897766&gid=SIGMA&cn=105&ln=340700&fn=pd12897620.pdf&cwn=31257-5&ui=72190&di=17548&ts=636437314781218843&v=&hc=C23E439D40143B76892356AE07FB7544",
"sourceType": "p",
"isCWGold": false,
"isWeWrite": false,
"isPrivate": false,
"isChemwatch": false,
"isAvailable": true,
"isLatest": true,
"groupName": "Sigma-Aldrich",
"docNo": "12897620",
"countryId": 105,
"languageId": 340700,
"preferredVendor": "Sigma-Aldrich (Merck)"
},
{
"materialId": "4897766",
"groupId": "SIGMA",
"vendorId": 25489,
"documentType": "ms",
"countryCode": "Norway",
"languageCode": "English",
"issueDate": "2012-12-04T00:00:00",
"fileName": "pd12897621.pdf",
"cwNumber": "31257-5",
"externalUrl": "http://jr.chemwatch.net/cwws/DocumentService.svc/GetDocumentContentByExternalUrl?mi=4897766&gid=SIGMA&cn=284&ln=340700&fn=pd12897621.pdf&cwn=31257-5&ui=72190&di=17548&ts=636437314781218843&v=&hc=72146D842EBC61E768BBFC5FE8F6E0D8",
"sourceType": "p",
"isCWGold": false,
"isWeWrite": false,
"isPrivate": false,
"isChemwatch": false,
"isAvailable": true,
"isLatest": true,
"groupName": "Sigma-Aldrich",
"docNo": "12897621",
"countryId": 284,
"languageId": 340700,
"preferredVendor": "Sigma-Aldrich (Merck)"
}
]
}
Method: Get Own Materials - "ownmaterials"
Used to get own Materials. Page & Sort parameters supported.
URL:
XML | GET /api/v1/ownmaterials |
JSON | GET /api/v1/json/ownmaterials |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
viewType | string | no | Possible values: material - MaterialName mode, preferred - PreferredName mode, catalog - CatName mode |
sortField | string | no | Sorting by field: "soursetype" - source tyoe cane be primary or secondary, "name" - default value |
sortDirection | string | no | Possible values: asc - sorting by ascending desc - sorting by descending |
pageNumber | integer | no | indicates page number |
pageSize | integer | no | indicates count of items per page |
Request Sample
GET /api/v1/ownmaterials?pageNumber=1&pageSize=15 |
Response Format:
Response body contains ListResult of Material object in XML (or JSON) format
XML Response Sample
<ListResultOfMaterial xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<PageCount>1</PageCount>
<PageNumber>1</PageNumber>
<PageSize>15</PageSize>
<RowCount>3</RowCount>
<Rows>
<Material>
<Cas>67-64-1</Cas>
<CwNo>1090</CwNo>
<Id>4200280</Id>
<IsGold>false</IsGold>
<MaterialData>
<Field>
<Name>CW</Name>
<Value>1090</Value>
</Field>
<Field>
<Name>NAME</Name>
<Value>acetone</Value>
</Field>
...
</MaterialData>
<Name>acetone</Name>
</Material>
...
</Rows>
</ListResultOfMaterial>
JSON Response Sample
{
"PageCount":1,
"PageNumber":1,
"PageSize":15,
"RowCount":3,
"Rows":[
{
"Cas":"67-64-1",
"CwNo":"1090",
"Id":4200280,
"IsGold":false,
"MaterialData":[
{"Name":"CW", "Value":"1090"},
{"Name":"NAME","Value":"acetone"},
...
],
"Name":"acetone"
},
...
]
}
Method: Get CwNumbers by Cas - "cwnumbers"
In most cases, CAS Number (Chemical Abstracts Service Number) is the "official" identifier for Pure Chemicals.
In most cases, Chemwatch Number (Chemwatch Chemical ID Number) corresponds to CAS one-to-one.
This Method provides the functionality to "get" the Chemwatch Number by passing a CAS number.
URL:
XML | GET /api/v1/cwnumbers |
JSON | GET /api/v1/json/cwnumbers |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
cas | string | yes | Cas number |
showOwn | bool | no | show cw numbers, which user has |
Request Sample
GET /api/v1/cwnumbers?cas=67-64-1 |
GET /api/v1/cwnumbers?cas=67-64-1&showOwn=true |
Response Format:
Response body contains an array of strings
XML Response Sample
<ArrayOfstring xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<string>1090</string>
<string>7122729</string>
<string>4896-40</string>
</ArrayOfstring>
JSON Response Sample
[
"1090",
"7122729",
"4896-40"
]
Material Data Requests
Method (GET): Get Material Data - "materialsdata"
This Method is used to obtain a predefined collection of data-points using a single request. This means the method is good to obtain data resolved by Chemwatch number, and not appropriate for Vendor Extracted Data (another method called materialsvgddata should be used in this case).
Data Methods can be created and managed in the Chemwatch Method Builder (separate URL and instructions available).
This Method is recommended where:
Large Collection of data points are required per request
Consistent collection of DP is required on an ongoing basis (e.g. GHS Label Data Method will return 15 end points required to populate a "label")
URL:
XML | GET /api/v1/materialsdata |
JSON | GET /api/v1/json/materialsdata |
CSV | GET /api/v1/csv/materialsdata |
XLS | GET /api/v1/xls/materialsdata |
HTML | GET /api/v1/html/materialsdata |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
ids | string | yes | Comma separated CwNumbers (if parameter entityType is material) or CAS number (if parameter entityType is cas) |
entityType | string | yes | Determines the type of previous parameter 'ids'. Possible values: material - means that 'ids' are CwNumbers cas - means that 'ids' are Cas Numbers Galleria data fields will only respond to entitytype = CAS. They will appear as empty when called on entitytype = material. |
methodName | string | yes (if dataPoints is missing) | UserMethod name. |
dataPoints | string | yes (if methodName is missing) | Comma separated DataPoint's names. |
languageId | integer | no | Language |
countryId | integer | no | Country |
saveTags | bool | no | |
separator | string | no | |
downloadImages | bool | no | Allows to download images |
folderId | integer | no | Folder |
msdsFormat | string | no | Msds Format. Possible values: reach, local or ghs |
Request Sample
GET /api/v1/materialsdata?ids=123,67-64-1&entityType=cas&methodName=Material_Name |
GET /api/v1/materialsdata?ids=1114&entityType=Material&dataPoints=MaterialName,CWNumber |
Response Format:
Response body contains an array of MaterialData objects in XML (JSON) format
XML Response Sample
<ArrayOfMaterialData xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<MaterialData>
<Field>
<Name>MaterialName</Name>
<Value>ROCHELLE - PURE CHEM TEST</Value>
</Field>
</MaterialData>
...
</ArrayOfMaterialData>
JSON Response Sample
[
[
{
"Name":"MaterialName",
"Value":"ROCHELLE - PURE CHEM TEST"
}
],
...
]
Important! Following values should be sent as integer
Possible values of MsdsFormat: None = 0, Reach = 1, Local = 2, Ghs =3
Possible values of EntityType: Material = 1, Cas = 2
Method: Get material data-points - "datapoints"
This Method is typically used for instant requests for single or a few data points (AD-HOC requests).
URL:
XML | GET /api/v1/datapoints |
JSON | GET /api/v1/json/datapoints |
Request Parameters: no
Request Sample
GET /api/v1/datapoints |
Response Format:
Response body contains an array of DataPoinCategory objects in XML (JSON) format (field SubCategories is object of type DataPoinCategory)
XML Response Sample
<ArrayOfDataPointCategory xmlns="http://schemas.datacontract.org/2004/07/Chemwatch.API.Entities" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<DataPointCategory>
<DataPoints>
<DataPoint xmlns="">
<Description>Ingredient 1</Description>
<Id>307</Id>
<Name>Ingredient1</Name>
</DataPoint>
...
</DataPoints>
<Name>Ingredients</Name>
<SubCategories/>
</DataPointCategory>
...
</ArrayOfMaterialData>
JSON Response Sample
[
{
"DataPoints":[
{
"Description":"Ingredient 1",
"Id":307,
"Name":"Ingredient1"
},
...
]
"Name":"Ingredients",
"SubCategories":[]
}
...
]
Method (GET): Get Material VGD Data - "materialsvgddata"
This Method is used to obtain a predefined collection of VGD using a single request.
Data Methods can be created and managed in the Chemwatch Method Builder (separate URL and instructions available).
Right now "materialsvgddata" method is reporting only the documents, which are in the user's folders
URL:
XML | GET /api/v1/materialsvgddata |
JSON | GET /api/v1/json/materialsvgddata |
CSV | GET /api/v1/csv/materialsvgddata |
XLS | GET /api/v1/xls/materialsvgddata |
HTML | GET /api/v1/html/materialsvgddata |
Request Parameters:
Query parameter | Data Type |
---|