• CVSoft
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi all, I got authentication and a first query ($query1) working, but I don't succeed making a query with a where clause in it ($query2). It results in a Bad Request. Any help is greatly appreciated.
 
$instance_url = Salesforce_user::get_instance_url($cg_user_id);

        $name = 'Guido';
        $query1 = "SELECT email , name , FirstName FROM LEAD LIMIT 1";
        $query2 = "SELECT email ,name, FirstName WHERE FirstName = '$name' FROM LEAD LIMIT 1";

        $query_encoded = urlencode($query1);
        $url = $instance_url . "/services/data/v45.0/query/?q=".$query_encoded;

        $options['headers']['content-type'] = 'application/json';
        
        $request = ApiController::$provider->getAuthenticatedRequest(
            'GET',
            $url,
            ApiController::static_oauth_get_access_token($cg_user_id), $options
        );

 
  • January 20, 2020
  • Like
  • 0