Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ChartURL / Knowtify.io Integration Example Part 2
# Part 1 at https://gist.github.com/ryana/7e64954d8dd15c858f30
def push_data_to_knowtify
api_token = "SEKRIT"
headers = {'Authorization' => "Token token=#{api_token}", 'Content-Type' => "application/json"}
url_base = "http://www.knowtify.io/api/v1"
endpoint = "/contacts/upsert"
data = {
contacts: [
{
name: "John",
email: "john@test.com",
data: {
category:"sports",
followers:300,
recent_activity_chart_url: charturl_url,
last_updated_at: Time.now.to_i
}
}
]
}
Typhoeus::Request.post("#{url_base}#{endpoint}", body: data.to_json, headers: headers)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.