Kev 69 Posted December 28, 2019 Report Share Posted December 28, 2019 Hi all, I am able to use an API key where the API key is part of the get request. However I've started to look at API keys that require the use of a Key and a Secret Key. Any idea how I would program ubot to do this? I am looking to http get a request and retrieve the response in JSON. For reference i'm looking at alpaca.markets for the APIs (100% free to use). Thanks in advance for your help. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted December 29, 2019 Report Share Posted December 29, 2019 From a cursory glance at this page: https://docs.alpaca.markets/api-documentation/api-v2/ it looks like you need to set the headers to contain the key and secret. Here's an example using http post: plugin command("HTTP post.dll", "http set headers", "APCA-API-KEY-ID", "YOUR_API_KEY_ID") plugin command("HTTP post.dll", "http set headers", "APCA-API-SECRET-KEY", "YOUR_API_SECRET_KEY") I've been working on a plugin to help with APIs. Should be out sometime soon. Quote Link to post Share on other sites
Kev 69 Posted December 29, 2019 Author Report Share Posted December 29, 2019 Thanks for this Nick, I was hoping you'd reply!I'll give this a whirl today and see how I get on. I signed up for your newsletter/sent you support ticket so hoping i am on your mailing list for plugin launch. Cheers, Kev Quote Link to post Share on other sites
Kev 69 Posted December 29, 2019 Author Report Share Posted December 29, 2019 Ok this is working a treat - am able to place my orders and handle response codes. Thanks for the direction, Nick! One more question if I may - how would I do: http DELETE using the http plugin? Is it possible? I'm able to test out the requests inside POSTMAN (application) but I need to bring it over to Ubot. Just don't know how to do DELETE requests with this plugin. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted December 29, 2019 Report Share Posted December 29, 2019 Try changing method plugin command("HTTP post.dll", "http method", "DELETE") Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.