Skip to content

Instantly share code, notes, and snippets.

@thiesen
Last active August 30, 2018 20:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thiesen/9512272 to your computer and use it in GitHub Desktop.
Save thiesen/9512272 to your computer and use it in GitHub Desktop.
Exemplo - Integração API RD Station em Ruby

Integrações RD Station

Ruby (HTTParty)

require 'httparty'

uri = "https://www.rdstation.com.br/api/1.2/conversions"
token = "SEU TOKEN" # Pode ser encontrado em https://www.rdstation.com.br/docs/api

params = {
  token_rdstation: token,
  identificador: 'identificador-canal-entrada',
  email: 'nathan.thiesen@resultadosdigitais.com.br',
  nome: 'Nathan Thiesen',
  empresa: 'Resultados Digitais',
  cargo: 'Developer',
  telefone: '123-456-789',
  celular: '9999-0000',
  website: 'www.resultadosdigitais.com.br',
  twitter: 'NathanThiesen',
}

post = HTTParty.post(uri, { :body => params })
raise "Response not HTTP OK: #{post.response.code}" if post.response.code != "200"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment