• Ashish Burnwal
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 5
    Replies
Hi

New to SalesForce. I'm trying to generate a Lead using the rest api and thankfully I've had a good reply. However the next hurdle is solving this error that is returned from the api call.
[
    {
        "message": "Session expired or invalid",
        "errorCode": "INVALID_SESSION_ID"
    }
]

I've reviewed the documentation on authorisation and its just a tad confusing. It states do not use SessionID if you are handling someones password, then states you must include username/password when getting a session id. Or am I missing something?

It also mentions client id and client secret. Can anyone tell me where I can find those? I've seen a few posts where its mentioned you can go to Create > Apps or Build > Create > Apps however I do not see those actions. 

Can anyone point me in the right direction? I'm using a developer account.

Thanks.



 
Hi all,

I’m a middle of make some trigger classes and found that trigger.new return list of sobject
What kind of situation would return size 2?
it would be much appreciated if someone give any examples of that

Thanks!
Not able to see Login button for all users on user detail page even if i'm an administrator in developer account. My "System administartor" profile has "Mange Users" and "Modify All Data" permission.

Hey everyone,

 

I'm working on an application, and I got the OAuth2 workflow working right away, but I've been struggling with making requests afterward.

 

I get the access_token and instance_url back, and when I make a call like this:

 

 

curl -v https://__instance_id__ (na7).salesforce.com/services/data/v20.0/ -H "Authorization: OAuth access_token_from_earlier"

 

the server responds with a 401 with the following body:

[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]

 

I've scoured the forum for solutions already, and made sure that I have API access turned on, signed up for the REST API through the developer preview form, but am still having errors all over the place.

 

Any help would be greatly appreciated.

 

Thanks!

If I issue a SOQL query that includes aggregate functions, I get back a list of AggregateResult objects. From each of those, I can use ar.get('fieldname') to get the various values. But that assumes I know the names of the field. If I do a Dynamic SOQL query from a VF page controller, where the query is based on input from the user, I may not know the field names ahead of time. How can I determine the fieldnames to use when I want to access the contents of an AggregateResult object?

 

Having read that an AggregateResult is a special type of SObject, I tried using Dynamic Apex to discover the fields:

 

List<AggregateResult> lst = database.query('select count(id), grp__c from myobj__c group by grp__c');

Schema.SObjectType sot = lst.getSObjectType();
Schema.DescribeSObjectResult res = sot.getDescribe();
Set<String> setFields = res.fields.getMap().keyset();
System.debug('Fields are: ' + setFields);

But the only field I get back is "id."  

 

Thanks for your help!

  • July 28, 2010
  • Like
  • 0

Hey everyone,

 

I'm working on an application, and I got the OAuth2 workflow working right away, but I've been struggling with making requests afterward.

 

I get the access_token and instance_url back, and when I make a call like this:

 

 

curl -v https://__instance_id__ (na7).salesforce.com/services/data/v20.0/ -H "Authorization: OAuth access_token_from_earlier"

 

the server responds with a 401 with the following body:

[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]

 

I've scoured the forum for solutions already, and made sure that I have API access turned on, signed up for the REST API through the developer preview form, but am still having errors all over the place.

 

Any help would be greatly appreciated.

 

Thanks!