I want to create lead record using integration of php platform. I have written rest API for that. The code is working fine when tested on workbench. But now I have integrated salesforce with PHP platform. I do recieved the correct access code,client_id,client_secret,username,password, security token,Authorization:OAuth . I am sending the response in JSON format. But I am facing the issue like :


[0] => Array
            [message] => This session is not valid for use with the REST API
            [errorCode] => INVALID_SESSION_ID

How do I fix this?

  • How are you authenticating and getting a Session ID?
    – David Reed
    Feb 5, 2019 at 12:19

1 Answer 1


@David Reed, yes i am getting session ID. Actually I had missed two factor authentication setting in session setting.Now the error is solved.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .