https://github.com/tegon/salesforce-lead
Create a Lead in Salesforce
https://github.com/tegon/salesforce-lead
Last synced: about 2 months ago
JSON representation
Create a Lead in Salesforce
- Host: GitHub
- URL: https://github.com/tegon/salesforce-lead
- Owner: tegon
- License: mit
- Created: 2015-08-14T03:35:16.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-04-05T12:12:57.000Z (about 9 years ago)
- Last Synced: 2025-12-25T17:16:14.778Z (6 months ago)
- Language: Ruby
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# salesforce-lead
Create Leads using Salesforce API
[](http://badge.fury.io/rb/salesforce-lead)
# Usage
### Constructor
---
```ruby
attributes: {
last_name: String
email: String
company: String
job_title: String
phone: String
website: String
}
credentials: {
token: String
instance_url: String
}
```
#### Example
```ruby
Salesforce::Lead.new({
last_name: 'Doe',
email: 'john@doe.com',
company: 'Foo Bar Inc.',
job_title: 'Developer',
phone: '55011998012345',
website: 'http://johndoe.com'
}, {
token: 'Token123ABC',
instance_url: 'http://n123.salesforce.com'
})
```
### Methods
---
#### create
Sends the Lead to Salesforce API. Returns false if an error has ocurred or true if the request was succesfull.
#### success?
Check if the request succeed
### Attributes
---
#### errors
When the request fails, the errors are stored in this array
##### Example
```ruby
[{ message: 'Bad Request', code: 'BAD_REQUEST' }]
```
# Development
Install the dependencies
```bash
bundle install
```
Run the test suite
```bash
rake test
```