The correct API key has been replaced as “mykey” above and I have verified that my API key works through a macro enabled worksheet connecting to companies house.
I am however getting 401 unauthorized error in SAS with the above, can anybody help?
AUTH_BASIC is apparently available from SAS 9.4M3. However if you’re using a lower version of SAS you will need to make your own authentication header. The SAS docs say:
HEADERIN=fileref-to-request-header-file
specifies a fileref to a text file that contains one line per request header in the format key:value.
Note: Beginning with SAS 9.4M3, this option is supported only for compatibility with previous versions of SAS software. Use the HEADERS Statement instead of HEADERIN=
For how to construct the header see the CH docs and examples on the forum like the one following (see response from csmith):