Created
March 5, 2016 17:17
-
-
Save AbeCole/f2c4a007faa7d54af79e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'json' | |
API_TOKEN = 'YOUR_API_TOKEN' | |
data = { | |
:event => 'client/create', | |
:target_url => 'CALLBACK_URL_HERE' | |
} | |
uri = URI("https://hook.vcita.com/v1/subscriptions/standard/subscribe") | |
request = Net::HTTP::Post.new(uri) | |
request.set_form_data(data) | |
request["Authorization"] = "Token #{API_TOKEN}" | |
res = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) do |http| | |
http.request(request) | |
end | |
return res.body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Abe,
The only thing that is preventing this from working is to send the parameters as a json string.
Thanks,
B.
Here is some sample code: