Overview
Chewatch 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).
All operations start with creating a "session". The session is persistent and exists until connection is terminated or times out. The session has a unique identifier, a security token that should be provided to the server on every call following authentication.
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.
REST
Service URL
Base Service URL | http://jr.chemwatch.net/api/v1 |
---|
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:
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:
HTTP/1.1 401 Unauthorized Cache-Control: private Content-Length: 50 Content-Type: application/json { "Code":401, "Message":"User is not authenticated" }
Operations:
Authentication
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.
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>
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
<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
{ "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.
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>
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
<ArrayOfCountry xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <Country> <Code>ARG</Code> <Id>81</Id> <Name>Argentina</Name> </Country> ... </ArrayOfCountry>
[ { "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
<ArrayOfLanguage xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <Language> <Code>AR</Code> <Id>340719</Id> <Name>Arabic</Name> </Language> ... </ArrayOfLanguage>
[ { "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 |
smiles | string | no | Smiles 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 |
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
<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" }, ... ] }
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 |
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
<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" }, ... ] }
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
<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>
[ "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.
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
|
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
<ArrayOfMaterialData xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <MaterialData> <Field> <Name>MaterialName</Name> <Value>ROCHELLE - PURE CHEM TEST</Value> </Field> </MaterialData> ... </ArrayOfMaterialData>
[ [ { "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)
<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>
[ { "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 | Required | Description |
---|---|---|---|
docNumbers | string | yes | Comma separated Document Numbers |
methodName | string | yes (if dataPoints is missing) | UserMethod name. |
dataPoints | string | yes (if methodName is missing) | Comma separated DataPoint's names. |
saveTags | bool | no | |
separator | string | no | |
downloadImages | bool | no | Allows to download images |
msdsFormat | string | no | Msds Format. Possible values: reach, local or ghs |
Request Sample
GET /api/v1/materialsvgddata?docnumbers=11133975&methodName=Material_Name |
Response Format:
Response body contains an array of MaterialData objects in XML (JSON) format
<ArrayOfMaterialData xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <MaterialData> <Field> <Name>MaterialName</Name> <Value>ROCHELLE - PURE CHEM TEST</Value> </Field> </MaterialData> ... </ArrayOfMaterialData>
[ [ { "Name":"MaterialName", "Value":"ROCHELLE - PURE CHEM TEST" } ], ... ]
Method: Search Vendors - "vendors"
This method allow searching Vendors and Vendor Ids available in the system. Sometimes vendor ID can be used in the subsequent calls for data.
URL:
XML | GET /api/v1/vendors |
JSON | GET /api/v1/json/vendors |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
name | string | yes | Vendor name |
sortField | string | no | Sorting by field |
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/vendors?name=merc |
Response Format:
Response body contains ListResult of Vendor object in XML (JSON) format
<ListResultOfVendor xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <PageCount>32</PageCount> <PageNumber>1</PageNumber> <PageSize>10</PageSize> <RowCount>319</RowCount> <Rows> <Vendor> <City>Cabo PE</City> <Country> <Code>BRA</Code> <Id>85</Id> <Name>Brazil</Name> </Country> <Gid>PETROFLE</Gid> <Id>1785</Id> <Name>Petroflex Industria E Comercio</Name> <State/> <VendorGroupId>45360</VendorGroupId> </Vendor> ... </Rows> </ListResultOfVendor>
{ "PageCount":32, "PageNumber":1, "PageSize":10, "RowCount":319, "Rows":[ { "City":"Cabo PE", "Country":{"Code":"BRA","Id":"85","Name":"Brazil"}, "Gid":"PETROFLE", "Id":1785, "Name":"Petroflex Industria E Comercio", "State":"", "VendorGroupId":45360 }, ... ] }
Document Requests
Get Documents - method "documents"
This Method is used to obtain a Vendor SDS from the Chemwatch Database.
URL:
XML | GET /api/v1/documents |
JSON | GET /api/v1/json/documents |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
cwNo | string | yes | Cw Number |
gid | string | no | GID search parameter |
folderId | integer | no | Folder |
languageIds | integer (comma separated) | no | Comma separated Languges Ids |
countryIds | integer (comma separated) | no | Comma separated Countries Ids |
own | bool | no | Searched Own collection is set to true. If set to false searched in Full database |
sortField | string | no | Sorting by field |
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/documents?cwNo=1090 |
Response Format:
Response body contains ListResult of Document object in XML (JSON) format
<ListResultOfDocument xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <PageCount>194</PageCount> <PageNumber>1</PageNumber> <PageSize>10</PageSize> <RowCount>1936</RowCount> <Rows> <Document> <CWNumber>10019</CWNumber> <CountryCode>United States</CountryCode> <CountryId>140</CountryId> <DocNo>4624274</DocNo> <DocumentType>ms</DocumentType> <ExternalUrl>http://dev.chemwatch.net/CWWS.M3/DocumentService.svc/GetDocumentContentByExternalUrl...</ExternalUrl> <FileName>pd4624274.htm.gz</FileName> <FolderId i:nil="true"/> <GroupId>ALCANAL</GroupId> <GroupName>Alcan</GroupName> <IsAvailable>true</IsAvailable> <IsCWGold>false</IsCWGold> <IsChemwatch>false</IsChemwatch> <IsLatest>false</IsLatest> <IsPrivate>false</IsPrivate> <IsWeWrite>false</IsWeWrite> <IssueDate>1992-07-27T00:00:00</IssueDate> <LanguageCode>English</LanguageCode> <LanguageId>340700</LanguageId> <MaterialId>5566246</MaterialId> <PreferredVendor>Alcan</PreferredVendor> <SourceType>p</SourceType> <VendorId>4200000272</VendorId> </Document> ... </Rows> </ListResultOfDocument>
{ "PageCount":194, "PageNumber":1, "PageSize":10, "RowCount":1936, "Rows":[ { "CWNumber":"10019", "CountryCode":"United States", "CountryId":140, "DocNo":"4624274", "DocumentType":"ms", "ExternalUrl":"http:\/\/dev.chemwatch.net\/CWWS.M3\/DocumentService.svc...", "FileName":"pd4624274.htm.gz", "FolderId":null, "GroupId":"ALCANAL", "GroupName":"Alcan", "IsAvailable":true, "IsCWGold":false, "IsChemwatch":false, "IsLatest":false, "IsPrivate":false, "IsWeWrite":false, "IssueDate":"\/Date(712159200000+1000)\/", "LanguageCode":"English", "LanguageId":340700, "MaterialId":"5566246", "PreferredVendor":"Alcan", "SourceType":"p", "VendorId":4200000272 }, ... ] }
Get Documents by Part Number - method "GetDocumentsByPartNumber"
This Method is used to obtain a Vendor SDS from the Chemwatch Database using Part Number.
URL:
XML | GET /api/v1/GetDocumentsByPartNumber |
JSON | GET /api/v1/json/GetDocumentsByPartNumber |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
userPartNumber | string | yes | Part Number |
gid | string | no | GID search parameter |
folderId | integer | no | Folder |
languageIds | integer (comma separated) | no | Comma separated Languges Ids |
countryIds | integer (comma separated) | no | Comma separated Countries Ids |
own | bool | no | Searched Own collection is set to true. If set to false searched in Full database |
sortField | string | no | Sorting by field |
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/GetDocumentsByPartNumber?userPartNumber=123 |
Response Format:
Response body contains ListResult of Document object in XML (JSON) format
<ListResultOfDocument xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><PageCount>2</PageCount><PageNumber>1</PageNumber><PageSize>10</PageSize><RowCount>18</RowCount> <Rows> <Document><CWNumber>1090</CWNumber><CountryCode>ANY</CountryCode><CountryId>0</CountryId><DocNo>a1090</DocNo><DocumentType>ms</DocumentType> <ExternalUrl>http://jr.chemwatch.net/cwws/MaterialService.svc/GetMsdsByExternalUrl?mi=4200280&cn=ANY&ln=ANY&fn=&cwn=1090&ui=72190&di=17548&ts=636437315161229971&v=&hc=946C8C579E77CF57471DB8763C8F56E7</ExternalUrl><FileName/><FolderId i:nil="true"/><GroupId>CW</GroupId><GroupName>ChemWatch</GroupName><IsAvailable>true</IsAvailable><IsCWGold>true</IsCWGold><IsChemwatch>true</IsChemwatch><IsLatest>true</IsLatest><IsPrivate>false</IsPrivate><IsWeWrite>false</IsWeWrite><IssueDate>2016-02-25T00:00:00</IssueDate><LanguageCode>ANY</LanguageCode><LanguageId>0</LanguageId><MaterialId>4200280</MaterialId><PreferredVendor>ChemWatch</PreferredVendor><SourceType>p</SourceType><VendorId>-1</VendorId></Document> <Document><CWNumber>31257-5</CWNumber><CountryCode>Netherlands</CountryCode><CountryId>118</CountryId><DocNo>6192754</DocNo><DocumentType>ms</DocumentType> <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=636437315161229971&v=&hc=7CEE0BE193FE0FC70B5E6AC7E7C81380</ExternalUrl><FileName>pd6192754.txt.gz</FileName><FolderId i:nil="true"/><GroupId>SIGMA</GroupId><GroupName>Sigma-Aldrich</GroupName><IsAvailable>true</IsAvailable><IsCWGold>false</IsCWGold><IsChemwatch>false</IsChemwatch><IsLatest>true</IsLatest><IsPrivate>false</IsPrivate><IsWeWrite>false</IsWeWrite><IssueDate>2007-02-15T00:00:00</IssueDate><LanguageCode>Dutch</LanguageCode><LanguageId>340711</LanguageId><MaterialId>4897766</MaterialId><PreferredVendor>Sigma-Aldrich (Merck)</PreferredVendor><SourceType>p</SourceType><VendorId>4200002922</VendorId></Document> ... </Rows> </ListResultOfDocument>
{ "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=636437315544361059&v=&hc=EEB831CCF61D46F07542D09A53A21985", "sourceType": "p", "isCWGold": true, "isWeWrite": false, "isPrivate": false, "isChemwatch": true, "isAvailable": true, "isLatest": true, "groupName": "ChemWatch", "docNo": "a1090", "countryId": 0, "languageId": 0, "preferredVendor": "ChemWatch" }, ... ] }
Get report / document in HTML - "report"
This Method is used to obtain Chemwatch Documents and reports generated using "Templates".
These include GOLD SDS, Mini SDS, Labels, etc.
With this "method" the API will "serve" a HTML document.
Note: The list of available Templates can be obtained using Templates method.
URL:
XML | GET /api/v1/report |
JSON | GET /api/v1/json/report |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
template | string | yes (see Get Templates) | Template name |
templateId | int | yes (only if CustomTemplate is selected) | Report's template |
cwNo | string | yes | Cw Number |
materialId | integer | no | Material Id |
userPartNumber | string | no | User's PartNumber |
vendorId | long | no | Vendor Id (use for WeWrites) |
countryId | integer | no | Indicates country of report |
languageId | integer | no | Indicates language of report |
Request Sample
GET /api/v1/report?template=spills&cwNo=1090 |
Response Format:
Response body contains string with html report
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN... </string>
"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional..."
Get report / document in PDF - method pdfreport
This Method is used to obtain Chemwatch Documents and reports generated using "Templates". These include GOLD SDS, Mini SDS, Labels, etc.
With this "method" the API will "serve" a PDF document.
Note: The list of available Templates can be obtained using Templates method
URL:
XML | GET /api/v1/pdfreport |
JSON | GET /api/v1/json/pdfreport |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
template | string | yes (see Get Templates) | Template name |
templateId | int | yes (only if CustomTemplate is selected) | Report's template |
cwNo | string | yes | Cw Number |
materialId | integer | no | Material Id |
userPartNumber | string | no | User's PartNumber |
vendorId | long | no | Vendor Id (use for WeWrites) |
countryId | integer | no | Indicates country of report |
languageId | integer | no | Indicates language of report |
Request Sample
GET /api/v1/pdfreport?template=mini&cwNo=1090 |
Response Format:
Response contains stream of pdf file. (You can see pdf report in browser directly)
Get Templates - method "templates"
URL:
XML | GET /api/v1/templates |
JSON | GET /api/v1/json/templates |
Request Parameters: no
Request Sample
GET /api/v1/templates |
Response Format:
Response body contains an array of TemplateSummary objects in XML (JSON) format
<ArrayOfTemplateSummary xmlns="http://schemas.datacontract.org/2004/07/Chemwatch.API.Entities" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <TemplateSummary> <Description>Custom template or Label</Description> <Template>CustomTemplate</Template> </TemplateSummary> <TemplateSummary> <Description>Standard operating procedure</Description> <Template>Sop</Template> </TemplateSummary> ... </ArrayOfTemplateSummary>
[ { "Description":"Custom template or Label", "Template":"CustomTemplate" }, { "Description":"Standard operating procedure", "Template":"Sop" }, ... ]
Template types:
Template | Description |
---|---|
CustomTemplate | Chose this type to specify template by IDs. Should be used for all labels. |
Msds | Chemwatch SDS. |
Mini | Chemwatch Mini SDS. |
FireFighting | Fire fighting report, |
FirstAid | First aid advice. |
Spills | Spills control report. |
China | CHINA report. |
AdviceToDoctor | Advice to doctor. |
Environmental | Environment report. |
Ppe | Personal protection means. |
Sop | Standard operating procedure. |
Toxicological | Toxicological report. |
Epg | EPG report. |
Trec | TREC reprot. |
Get Vendor SDS - method document
This Method is used to obtain Vendor SDS document
With this "method" the API will "serve" document with extension provided in request
Note: The list of available document names can be obtained using
URL:
XML | GET /api/v1/document |
JSON | GET /api/v1/json/document |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
fileName | string | yes | Document name |
Request Sample
GET /api/v1/document?fileName=pd11407714.pdf |
Response Format:
Response contains stream of file with extension provided in fileName parameter . (Vendor SDS is downloaded automatically)
Msds Request
Send Msds Request - method "MsdsRequest"
This method sends Msds Request
URL:
XML | POST /api/v1/msdsrequest | additional http header: Content-Type: application/xml; charset=utf-8 |
JSON | POST /api/v1/json/msdsrequest | additional http header: Content-Type: application/json; charset=utf-8 |
Request Sample
POST /api/v1/msdsrequest Content-Type: application/xml; charset=utf-8 |
Request body
<MsdsRequestEntity> <ProductName>test xml</ProductName> <ProductNumber>test xml</ProductNumber> <Vendor>test xml</Vendor> </MsdsRequestEntity>
Response Format:
Response body contains a boolean value
<boolean>true</boolean>
JSON Request Sample
POST /api/v1/json/msdsrequest Content-Type: application/json; charset=utf-8 |
Request body
{"ProductName":"test", "ProductNumber": "test", "Vendor": "test"}
Response Format:
Response body contains a boolean value
true
Folder Node Methods
Get Folder Id By Full Path - method "folderIdByFullPath"
This method is used to obtain folder ID by full path provided as a parameter. It helps in the subsequent calls which allow restricting results by a sub-tree (folder ID passed in become a root folder for the sub-tree). Only results belonging to the specified folder and all its children will be returned.
URL:
XML | GET /api/v1/folderIdByFullPath |
JSON | GET /api/v1/json/folderIdByFullPath |
Request Parameters:
Query parameter | Data Type | Required | Description |
---|---|---|---|
path | string | yes | Full folder path |
Request Sample
GET /api/v1/FolderIdByFullPath?path=ENTERPRISE/FOLDERS/benz |
Response Format:
Response body contains just integer folder Id
<int xmlns="http://schemas.microsoft.com/2003/10/Serialization/">1012072</int>
1012072
Get Root Folder Id - method RootFolderId
This method is used to obtain Root Folder ID. Folder ID may be useful in subsequent queries.
URL:
XML | GET /api/v1/RootFolderId |
JSON | GET /api/v1/json/RootFolderId |
Request Parameters:
None
Request Sample
GET /api/v1/RootFolderId |
Response Format:
Response body contains just integer folder Id
<int xmlns="http://schemas.microsoft.com/2003/10/Serialization/">997557</int>
997557
SOAP
Endpoint
http://jr.chemwatch.net/api/chemwatchservice.svc/soap |
WSDL
http://jr.chemwatch.net/API/ChemwatchService.svc/soap?wsdl |
SOAP endpoint is useful for generating client code to access a web service.
e.g. svcutil.exe (https://msdn.microsoft.com/en-us/library/aa347733%28v=vs.110%29.aspx)
- Possible values of MsdsFormat: None = 0, Reach = 1, Local = 2, Ghs =3
- Possible values of EntityType: Material = 1, Cas = 2
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 |
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
<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)" } ] }