demarches-normaliennes/app/lib/pipedrive/organization_adapter.rb
2018-05-24 17:15:44 +02:00

13 lines
316 B
Ruby

class Pipedrive::OrganizationAdapter
def self.add_organization(name, address)
params = {
name: name,
owner_id: Pipedrive::PersonAdapter::PIPEDRIVE_ROBOT_ID,
address: address
}
response = Pipedrive::API.post_organization(params)
JSON.parse(response.body)['data']['id']
end
end