Effacer les filtres
Effacer les filtres

Chemicalize REST/API not working

5 vues (au cours des 30 derniers jours)
Camila Carvalho
Camila Carvalho le 27 Juil 2020
I'm trying to use MATLAB to get chemical information about multiple compounds using the Chemicalize REST API. I have a PRO account, but everytime I try to use the code, it keeps giving me this error:
Error using matlab.internal.webservices.HTTPConnector/copyContentToByteArray (line 396)
The server returned the status 401 with message "" in response to the request to URL
https://api.chemicalize.com/v1/calculate/aspirin.
Error in readContentFromWebService (line 46)
byteArray = copyContentToByteArray(connection);
Error in webwrite (line 139)
[varargout{1:nargout}] = readContentFromWebService(connection, options);
Error in smilestocheminfo (line 5)
z = webwrite(url, options);
Am I doing something wrong? It says on the website that, for evaluation purposes, the molecule 'aspirin' should not require a subscription, so I don't know how to do this.
The code I'm using is:
clear; clc
api = 'https://api.chemicalize.com/v1/';
url = [api 'calculate/aspirin'];
options = weboptions('Username','myusername','Password','mypassword');
z = webwrite(url, options);
S = webread(z);

Réponses (0)

Catégories

En savoir plus sur Chemistry dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by