Passing select query in the REST URL

kalyangkm
kalyangkm used Ask the Experts™
on
Hi,
I am trying to fetch some data by doing a query to Salesforce.com DB.
For that I use a REST adapter and I have to pass a query in the REST URL.

I have the following Query to pass
select AccountId, CreatedDate, ActivatedDate, (select CreatedById, from OrderItems) from Order

and I am able to successfully pass it using the following URL string
https://XXXXXXXX.com/services/data/v20.0/query/?q=SELECT+AccountId%2c+CreatedDate%2c+ActivatedDate%2c+%28SELECT+CreatedById+from+OrderItems%29+from+Order

which results in the following output
{
    "totalSize": 1,
    "done": true,
    "records": [
        {
            "attributes": {
                "type": "Order",
                "url": "/services/data/v20.0/sobjects/Order/XXXXXXXXXX"
            },
            "AccountId": "YYYYYFFFFFFFFFF",
            "CreatedDate": "2019-11-22T01:30:16.000+0000",
            "ActivatedDate": null,
            "OrderItems": null
        }
    ]
}

My next task is to pass the "CreatedDate" value as "2019-11-22T01:30:16.000+0000" to fetch the same output result. So I am trying to figure out how I can build the query to pass the date string with all the encoded characters ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
Hi Folks,

Can I get some feedback on my question?

Author

Commented:
I am still waiting on this.

Author

Commented:
hi folks, is there no expertise on REST based url?

Author

Commented:
I solved the problem my self.

The following format solved the issue.

/services/data/v20.0/query/?q=SELECT+AccountId%2c+CreatedDate%2c+ActivatedDate%2c+%28SELECT+CreatedById+from+OrderItems%29+from+Order+WHERE+CreatedDate+=+2019-11-22T01:30:16.000Z
I solved the problem my self.

The following format solved the issue.

/services/data/v20.0/query/?q=SELECT+AccountId%2c+CreatedDate%2c+ActivatedDate%2c+%28SELECT+CreatedById+from+OrderItems%29+from+Order+WHERE+CreatedDate+=+2019-11-22T01:30:16.000Z

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial