/
Getting Started with Chemwatch Web Service API

Getting Started with Chemwatch Web Service API

Below is how to get started with Web API. There are few examples to jump start and try it out.
I also attached the complete documentation describing different methods and parameters. Please note, the Service also support SOAP/WSDL, which may be more convenient to implement than REST. Depends on the technology you will be using.

Authenticate into the Service

Use the x-api-key provded and pass it as a header with every API call, i.e.:

GET /api/v1/json/languages HTTP/1.1
Host: jr.chemwatch.net
x-api-key: <your-api-key>


Own Colleciton

Chemwatch hold so-called Own Collection on the materials for you, or just Own. Initially clients send us a list of chemcials they want to register and we run our internal process to identify those chemicals within our database. All found records are added to the client;s Own. New materials added after the initial data load, can be added via the same Registration channel or via a Web Service method.

Picking the Identifier

It's imporant to start Integration on a right foot. Identifier is what connects entities between two systems. If Vendor data is what is required by the client side, then it is recommended to store a client ID (your system ID) as a UserPartNumber on Chemwatch side. Then, a call to method /GetDocumentsByPartNumber can be used to find the right document.

User Part Number will be automatically moved to the latest edition of a material by the Chemwatch Registration team. Rest assured the data you are getting through this interface will always be the latest we could find for you.


Calling Service Methods

You may search by one of the following:

(Note: own=false defines search in full collection)

The search is fuzzy (close match) and the results are sorted by relevance. The most relevant result appears first on the list. Rate = 100 means it is an exact match.

The resulting CW number can be used as a key to a material in subsequent queries for data, vendors, or documents.


Requesting data

To retrieve data, use materialsdata method with a list of CW or CAS numbers and data fields names as parameters:
http://jr.chemwatch.net/api/v1/materialsdata?ids=34-4241&entityType=Material&dataPoints=MaterialName,Ingredients,SignalWord,HazardPhrases,PrecautionaryPhrases,PrecautionaryPhrasesPrevent,PrecautionaryPhrasesStorage,PrecautionaryPhrasesDisposal,DGC,ADGSubrisk,PackingGroup,UN,ChemwatchPPEGraphics,GHSPPEGraphics

Where dataPoints parameter contains names of data fields to get in the response. Various available data points can in turn be seen by running http://jr.chemwatch.net/api/v1/datapoints. Data can be requested in any of supported languages.

The same as above, but in JSON format:
http://jr.chemwatch.net/api/v1/json/materialsdata?ids=34-4241&entityType=Material&dataPoints=MaterialName,Ingredients,SignalWord,HazardPhrases,PrecautionaryPhrases,PrecautionaryPhrasesPrevent,PrecautionaryPhrasesStorage,PrecautionaryPhrasesDisposal,DGC,ADGSubrisk,PackingGroup,UN,ChemwatchPPEGraphics,GHSPPEGraphics

Another example:
http://jr.chemwatch.net/api/v1/materialsdata?ids=1114&entityType=Material&dataPoints=UserGoldPartNumber

Multiple CW numbers can be used in call, separated by coma.

You may also use a call to data by name of a method created in Report Generator:
http://jr.chemwatch.net/api/v1/materialsdata?ids=1114&entityType=material&methodName=method_name

There is also a possibility to use CAS number as a key to a material.

Regulatory and jurisdiction settings of the domain will apply automatically to the generated documents (Gold SDS, Mini, etc.)

Requesting documents

To request a document use a query like this (only one document can be requested at a time):

Chemwatch SDS as PDF: http://jr.chemwatch.net/api/v1/pdfreport?template=msds&cwNo=34-4241
Chemwatch Mini as PDF: http://jr.chemwatch.net/api/v1/pdfreport?template=mini&cwNo=34-4241
SDS in Html format: http://jr.chemwatch.net/api/v1/report?template=msds&cwNo=34-4241

Search Vendor SDS by CW number, country, and language: https://jr.chemwatch.net/api/v1/documents?cwNo=79-8038&countryIds=82,139,140,96&languageIds=340700,340686. Then simply pick up URL(s) from ExternalUrl XML node and load from the Web. The link looks like this: http://jr.chemwatch.net/cwws/DocumentService.svc/GetDocumentContentByExternalUrl?mi=4042100&gid=DOWCHEM&cn=84&ln=340711&fn=pd2978964.pdf&cwn=1114&ui=188851&di=61326&ts=636263508953796659&v=&hc=76833E520C0DA838DEB7853DEE1D89AC.

(Note: please do not mind http in the calls, all http calls are redirected to https ports on Server side).

Service functions

Countries and languages can be used in queries for data and all types of documents. 
http://jr.chemwatch.net/countries
http://jr.chemwatch.net/languages

SOAP

ServiceURL: http://jr.chemwatch.net/api/ChemwatchService.svc
SingleWSDL: http://jr.chemwatch.net/api/ChemwatchService.svc/soap?singleWsdl

Security

All http calls are redirected to https ports on Server side.