Fantastic! ('-H Ocp-Apim-Subscription-Key:',PrimarykeyRB) gethttp ' https://api-test.riksbank.se/swea/v1/Observations/SEKUSDPMI/2023-01-01'
worked perfectly. Many thanks, Pablo On Wed, Sep 20, 2023 at 3:09 PM Michael Dykman <mdyk...@gmail.com> wrote: > In the document at https://code.jsoftware.com/wiki/Addons/web/gethttp > It states that > -- > x is: Optional retrieval options. One of: > 'stdout' (Default) > 'help' > 'file' or ('file';jpath '~temp/myfile.htm') > Anything else is assumed to be a valid Wget/cURL option string > eg: 'file' gethttp 'http://www.jsoftware.com' > eg: ('-o - --stderr ',jpath '~temp/gethttp.log') gethttp ' > http://www.jsoftware.com' > -- > > Depending on your platform, J is using either curl or wget under the hood. > > What you need to do is to add a header to your request. The header name > will be 'Ocp-Apim-Subscription-Key' and the value, whatever key you > received. > > If it's curl under the hood, the option to add a header is '-H > headername:headervaue'. I would have to look it up for wget. > > > Compose that string and pass it on the left hand side of httpget > > > > > On Wed, Sept 20, 2023, 08:56 Pablo Landherr <pablo.landh...@gmail.com> > wrote: > > > I have a follow-up question. I've successfully sent a number of requests > > and received data. However, they have a rate limit for unregistered > users. > > So I registered and was given keys, but I don't understand how to use > them. > > The documentation says that I should add the key in a http header called > > Ocp-Apim-Subscription-Key. Given that my requests were something like > this: > > > > gethttp ' > > https://api-test.riksbank.se/swea/v1/Observations/SEKUSDPMI/2023-01-01' > > > > > > how do I modify this to include the key? > > > > > > Thank you, > > > > Pablo > > > > > > > > On Tue, Sep 19, 2023 at 1:05 PM Pablo Landherr <pablo.landh...@gmail.com > > > > wrote: > > > > > That was easy enough. Thank you, however the wiki page should be > updated > > > as the first examples don't work as shown. E.g. > > > > > > $homepagehtml=: gethttp 'http://www.jsoftware.com' > > > > > > 293 > > > > > > 106 {. 306}.homepagehtml NB. as suggested on the wiki > > > > > > homepagehtml > > > > > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> > > > > > > <html><head> > > > > > > <title>302 Found</title> > > > > > > </head><body> > > > > > > <h1>Found</h1> > > > > > > <p>The document has moved <a href="https://www.jsoftware.com/ > > > ">here</a>.</p> > > > > > > <hr> > > > > > > <address>Apache/2.4.29 (Ubuntu) Server at www.jsoftware.com Port > > > 80</address> > > > > > > </body></html> > > > > > > > > > > > > On Tue, Sep 19, 2023 at 12:55 PM Pablo Landherr < > > pablo.landh...@gmail.com> > > > wrote: > > > > > >> Thank you. Will start there. > > >> > > >> On Tue, Sep 19, 2023 at 12:47 PM Ed Gottsman < > > edward.j.gotts...@gmail.com> > > >> wrote: > > >> > > >>> Pablo, > > >>> > > >>> This is a good place to start. It describes gethttp, an add-on that > > >>> front-ends curl and wget (depending on your platform). > > >>> > > >>> > > >>> https://code.jsoftware.com/wiki/Addons/web/gethttp > > >>> > > >>> Best of luck and feel free to ask questions. > > >>> > > >>> Ed > > >>> > > >>> > On Sep 19, 2023, at 11:42 AM, Pablo Landherr < > > pablo.landh...@gmail.com> > > >>> wrote: > > >>> > > > >>> > I have searched the J wiki but am unable to find some newbie > examples > > >>> > showing how to use J (client side) with rest API. I wish to > download > > >>> > statistics and my source only supports using their API. Side note, > I > > >>> have > > >>> > no experience writing API:s. > > >>> > > > >>> > Can anyone point me to the best place to start? > > >>> > > > >>> > Thank you, > > >>> > Pablo Landherr > > >>> > > > ---------------------------------------------------------------------- > > >>> > For information about J forums see > > http://www.jsoftware.com/forums.htm > > >>> > > >>> > ---------------------------------------------------------------------- > > >>> For information about J forums see > http://www.jsoftware.com/forums.htm > > >>> > > >> > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm