Chemicalize REST/API not working

조회 수: 2 (최근 30일)
Camila Carvalho
Camila Carvalho 2020년 7월 27일
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);

답변 (0개)

카테고리

Help CenterFile Exchange에서 Chemistry에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by