I understand that you are encountering 401 error,when trying to connect with Coinbase API.
- The 401 error typically indicates Unauthorized error.So,it is important to verify that the API URL and credentials you are using are correct and match the information provided by the API source.
- If everything checks out,then I would recommend defining a single structure for HeaderFields option as follows
header={
'CB-ACCESS-KEY', API_KEY;
'CB-ACCESS-SIGN', signature;
'CB-ACCESS-TIMESTAMP', timestamp;
'CB-ACCESS-PASSPHRASE', passphrase}
%or
header=struct('CB-ACCESS-KEY', API_KEY, 'CB-ACCESS-SIGN', signature, 'CB-ACCESS-TIMESTAMP', timestamp, 'CB-ACCESS-PASSPHRASE', passphrase, 'Content-Type', 'application/json');
- And, it is important noting that the syntax of ContentType option is different with different versions,so it is worth trying Content-Type inplace of ContentType.
I hope this resolves the issue,
Thanks and Regard,
Venkat Siddarth V.