Jump to content
UBot Underground

Apis With Keys And Secret Keys


Recommended Posts

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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

Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...