You need to sign in to do that
Don't have an account?
ag_name
REST API SOQL STRING QUERY
Hello,
I'm trying to experiment using the codes for integrating rest api and php by Mr. Pat Patterson, I wanted to insert the variable $id parameter to the following soql string query but it isn't working. Please help.
function show_accounts($instance_url, $access_token,$id) { $query = "SELECT Name, Id from Account WHERE Id =: \'' $id '\'"; $url = "$instance_url/services/data/v20.0/query?q=" . urlencode($query); . . . . }
The $id parameter should be salesforce id that will return by the query. Am I missing something? Please advise.
Ag_Name --
this is a guess, but I think what you need to do is remove the =: part of your query string. When you're building the string it's going to put the value of the variable in the string -- not the variable itself.
Example I'm passing "AccountName" into my query string. so I format it:
And it outputs:
Note - my AccountName variable contains the %25 before and after the name.