Questions tagged [restforce]

14 questions
2
votes
1 answer

How to get valid/invalid login from OAuth 2 for Ruby

I'm running the Restforce API, which I believe uses OAuth 2 from what I have read. The login I have works, but at this point I am just trying to make something that returns whether the login was successful or not. I have the username, password,…
Mike
  • 318
  • 2
  • 4
  • 13
2
votes
1 answer

Create object with relationship in Salesforce with Restforce using Rails

I use Ruby on Rails 4.2.5 with the Restforce gem for Salesforce API. I create a Contact in my controller : class CandidateFormController < ApplicationController def index client = Restforce.new( :username =>…
scoudert
  • 189
  • 2
  • 9
1
vote
0 answers

Passing a String[] or List to Salesforce Bulk Job for EventWhoIds in Ruby

I'm trying to create a job in Salesforce using the salesforce_bulk_api gem that adds EventWhoIds to an Event. I have been able to successfully do this using the restforce gem by simply passing in an array of Ids like this: sf_client.upsert!('Event',…
camillavk
  • 521
  • 5
  • 20
1
vote
1 answer

Could not subscribe to salesforce with API_VERSION 48 from restforce

I am currently subscribing for 2 topics one for Account and another for Contacts. I am successfully able to subscribe to both topics with api_version 26 (default version used by restforce), but I don't get events for delete actions with this…
SahSantoshh
  • 73
  • 2
  • 12
1
vote
0 answers

Restforce Salesforce REST API INVALID_SESSION_ID: Session expired or invalid

I am using the Rails Restforce gem to connect to my app to Salesforce. I am able to authenticate without issue and make calls to add/delete records. However after some period of time (many hours), I begin to get: Restforce::UnauthorizedError:…
cman77
  • 1,753
  • 1
  • 22
  • 48
1
vote
1 answer

Salesforce using Rails | Restforce gem | Error: Connection prefix not set

I am hitting Salesforce api using restforce gem. But on my local it is working completely fine for every case. But on staging server(AWS), it's throwing the following exception: Restforce::UnauthorizedError · app/services/sales_force_methods.rb:23 …
Sachin
  • 963
  • 11
  • 31
0
votes
0 answers

INVALID_SESSION_ID: Session expired or invalid - Restforce gem - Ruby on Rails - Salesforce API

I am getting a INVALID_SESSION_ID: Session expired or invalid I am using Restforce api to intereact with the Saleforce API. I made a connected app in salesforce. I set the Oauth options to: Selected OAuth Scopes Provide access to your data…
almusavi
  • 1
  • 2
0
votes
1 answer

Accessing the restforce collection to retrive data in a ruby script

This seems to be a basic thing, but kind of not sure on how to access the data from restforce::collection require 'restforce' ##set up the connection part here accounts = client.query('select Id, EventType, Logdate from EventLogFile where…
OK999
  • 1,353
  • 2
  • 19
  • 39
0
votes
2 answers

restforce gem save only changed attriubtes?

I'm using restforce to interat with salesforce in Ruby on Rails. I have this snippet of code: client = Restforce.new acc = client.find("Account", account_ID) acc.firstName = "test" acc.save # if I use update I get the same error acc.update But I…
Gamal Tawaf
  • 125
  • 1
  • 13
0
votes
1 answer

Parsing the data inside a ruby collection object

i am getting a response in the form of an object (#), when i hit a REST API. How can i format the response to say JSON, to parse it? Below is the result, if i do a p (to inspect) on the…
OK999
  • 1,353
  • 2
  • 19
  • 39
0
votes
0 answers

Getting invalid_grant: authentication failure

I try to connect to salesforce via restforce gem. I use next: client = Restforce.new(username: 'user@name.com', password: 'my_password', client_id: 'Consumer_Key', …
Den Silver
  • 199
  • 16
0
votes
0 answers

Rails app with Restforce gem: undefined local variable or method `current_user'

I followed the instructions http://geekymartian.com/articles/ruby-on-rails-4-salesforce-oauth-implementation/ When I run rake db:migrate I get the following error: NameError: undefined local variable or method 'current_user'…
Lut
  • 1,363
  • 1
  • 14
  • 30
0
votes
1 answer

How do I convert a lead in SFDC through API using Restforce Gem

I've been using the Restforce gem with Ruby (sans Rails) in order to add leads, contacts, and opps to Salesforce. Now I want to be able to convert a lead to a contact or account. Here is SFDC's documentation on the method I'd like to…
Maaack
  • 115
  • 10
-2
votes
1 answer

How to convert SOQL query to SQL query?

I am working on SQL query, I have pre-created SOQL query, I am looking for a way to convert it to SQL query. The query is: SELECT CronJobDetail.Name, Id, CreatedDate, State FROM CronTrigger WHERE CronjobDetail.JobType = 'bla bla' AND…
Gökhan Akduğan
  • 533
  • 1
  • 8
  • 17