Query

GET {{_endpoint}}/services/data/v{{version}}/query/?q=SELECT FIELDS(All) FROM ACCOUNT ORDER BY Name LIMIT 5

Executes the specified SOQL query.

If the query results are too large, the response contains the first batch of results and a query identifier in the nextRecordsUrl field of the response. The identifier can be used in an additional request to retrieve the next batch. https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_query.htm

Request Params

KeyDatatypeRequiredDescription
qstringA SOQL query. Note that you will need to replace spaces with “+” characters in your query string to create a valid URI. An example query parameter string might look like: “SELECT+Name+FROM+MyObject”. If the SOQL query string is invalid, a MALFORMED_QUERY response is returned.

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

{"totalSize":5,"done":true,"records":[{"attributes":{"type":"Account","url":"/services/data/v58.0/sobjects/Account/001B000000UnQ2wIAF"},"Id":"001B000000UnQ2wIAF","IsDeleted":false,"MasterRecordId":null,"Name":"Burlington Textiles Corp of America","Type":"Customer - Direct","ParentId":null,"BillingStreet":"525 S. Lexington Ave","BillingCity":"Burlington","BillingState":"NC","BillingPostalCode":"27215","BillingCountry":"USA","BillingLatitude":null,"BillingLongitude":null,"BillingGeocodeAccuracy":null,"BillingAddress":{"city":"Burlington","country":"USA","geocodeAccuracy":null,"latitude":null,"longitude":null,"postalCode":"27215","state":"NC","street":"525 S. Lexington Ave"},"ShippingStreet":null,"ShippingCity":null,"ShippingState":null,"ShippingPostalCode":null,"ShippingCountry":null,"ShippingLatitude":null,"ShippingLongitude":null,"ShippingGeocodeAccuracy":null,"ShippingAddress":null,"Phone":"(336) 222-7000","Fax":"(336) 222-8000","AccountNumber":"CD656092","Website":"www.burlington.com","PhotoUrl":"/services/images/photo/001B000000UnQ2wIAF","Sic":"546732","Industry":"Apparel","AnnualRevenue":350000000,"NumberOfEmployees":9000,"Ownership":"Public","TickerSymbol":"BTXT","Description":null,"Rating":"Warm","Site":null,"OwnerId":"005B0000003TOI6IAO","CreatedDate":"2017-08-18T14:46:22.000+0000","CreatedById":"005B0000003TOI6IAO","LastModifiedDate":"2017-08-18T14:46:22.000+0000","LastModifiedById":"005B0000003TOI6IAO","SystemModstamp":"2017-08-18T14:46:22.000+0000","LastActivityDate":null,"LastViewedDate":null,"LastReferencedDate":null,"IsPartner":false,"IsCustomerPortal":false,"ChannelProgramName":null,"ChannelProgramLevelName":null,"Jigsaw":null,"JigsawCompanyId":null,"CleanStatus":"Pending","AccountSource":null,"DunsNumber":null,"Tradestyle":null,"NaicsCode":null,"NaicsDesc":null,"YearStarted":null,"SicDesc":null,"DandbCompanyId":null,"CustomerPriority__c":null,"SLA__c":"Silver","Active__c":null,"NumberofLocations__c":6,"UpsellOpportunity__c":"Maybe","SLASerialNumber__c":"5367","SLAExpirationDate__c":"2016-09-12"},{"attributes":{"type":"Account","url":"/services/data/v58.0/sobjects/Account/001B000000UnQ2yIAF"},"Id":"001B000000UnQ2yIAF","IsDeleted":false,"MasterRecordId":null,"Name":"Dickenson plc","Type":"Customer - Channel","ParentId":null,"BillingStreet":"1301 Hoch Drive","BillingCity":"Lawrence","BillingState":"KS","BillingPostalCode":"66045","BillingCountry":"USA","BillingLatitude":null,"BillingLongitude":null,"BillingGeocodeAccuracy":null,"BillingAddress":{"city":"Lawrence","country":"USA","geocodeAccuracy":null,"latitude":null,"longitude":null,"postalCode":"66045","state":"KS","street":"1301 Hoch Drive"},"ShippingStreet":"1301 Hoch Drive","ShippingCity":"Lawrence","ShippingState":"KS","ShippingPostalCode":"66045","ShippingCountry":"USA","ShippingLatitude":null,"ShippingLongitude":null,"ShippingGeocodeAccuracy":null,"ShippingAddress":{"city":"Lawrence","country":"USA","geocodeAccuracy":null,"latitude":null,"longitude":null,"postalCode":"66045","state":"KS","street":"1301 Hoch Drive"},"Phone":"(785) 241-6200","Fax":"(785) 241-6201","AccountNumber":"CC634267","Website":"dickenson-consulting.com","PhotoUrl":"/services/images/photo/001B000000UnQ2yIAF","Sic":"6752","Industry":"Consulting","AnnualRevenue":50000000,"NumberOfEmployees":120,"Ownership":"Private","TickerSymbol":null,"Description":null,"Rating":null,"Site":null,"OwnerId":"005B0000003TOI6IAO","CreatedDate":"2017-08-18T14:46:22.000+0000","CreatedById":"005B0000003TOI6IAO","LastModifiedDate":"2017-08-18T14:46:22.000+0000","LastModifiedById":"005B0000003TOI6IAO","SystemModstamp":"2017-08-18T14:46:22.000+0000","LastActivityDate":null,"LastViewedDate":null,"LastReferencedDate":null,"IsPartner":false,"IsCustomerPortal":false,"ChannelProgramName":null,"ChannelProgramLevelName":null,"Jigsaw":null,"JigsawCompanyId":null,"CleanStatus":"Pending","AccountSource":null,"DunsNumber":null,"Tradestyle":null,"NaicsCode":null,"NaicsDesc":null,"YearStarted":null,"SicDesc":null,"DandbCompanyId":null,"CustomerPriority__c":"Low","SLA__c":"Bronze","Active__c":"Yes","NumberofLocations__c":2,"UpsellOpportunity__c":"No","SLASerialNumber__c":"7425","SLAExpirationDate__c":"2017-03-15"},{"attributes":{"type":"Account","url":"/services/data/v58.0/sobjects/Account/001B000000UnQ2vIAF"},"Id":"001B000000UnQ2vIAF","IsDeleted":false,"MasterRecordId":null,"Name":"Edge Communications","Type":"Customer - Direct","ParentId":null,"BillingStreet":"312 Constitution Place\nAustin, TX 78767\nUSA","BillingCity":"Austin","BillingState":"TX","BillingPostalCode":null,"BillingCountry":null,"BillingLatitude":null,"BillingLongitude":null,"BillingGeocodeAccuracy":null,"BillingAddress":{"city":"Austin","country":null,"geocodeAccuracy":null,"latitude":null,"longitude":null,"postalCode":null,"state":"TX","street":"312 Constitution Place\nAustin, TX 78767\nUSA"},"ShippingStreet":"312 Constitution Place\nAustin, TX 78767\nUSA","ShippingCity":null,"ShippingState":null,"ShippingPostalCode":null,"ShippingCountry":null,"ShippingLatitude":null,"ShippingLongitude":null,"ShippingGeocodeAccuracy":null,"ShippingAddress":{"city":null,"country":null,"geocodeAccuracy":null,"latitude":null,"longitude":null,"postalCode":null,"state":null,"street":"312 Constitution Place\nAustin, TX 78767\nUSA"},"Phone":"(512) 757-6000","Fax":"(512) 757-9000","AccountNumber":"CD451796","Website":"http://edgecomm.com","PhotoUrl":"/services/images/photo/001B000000UnQ2vIAF","Sic":"6576","Industry":"Electronics","AnnualRevenue":139000000,"NumberOfEmployees":1000,"Ownership":"Public","TickerSymbol":"EDGE","Description":"Edge, founded in 1998, is a start-up based in Austin, TX. The company designs and manufactures a device to convert music from one digital format to another. Edge sells its product through retailers and its own website.","Rating":"Hot","Site":null,"OwnerId":"005B0000003TOI6IAO","CreatedDate":"2017-08-18T14:46:22.000+0000","CreatedById":"005B0000003TOI6IAO","LastModifiedDate":"2017-08-18T14:46:22.000+0000","LastModifiedById":"005B0000003TOI6IAO","SystemModstamp":"2017-08-18T14:46:22.000+0000","LastActivityDate":null,"LastViewedDate":null,"LastReferencedDate":null,"IsPartner":false,"IsCustomerPortal":false,"ChannelProgramName":null,"ChannelProgramLevelName":null,"Jigsaw":null,"JigsawCompanyId":null,"CleanStatus":"Pending","AccountSource":null,"DunsNumber":null,"Tradestyle":null,"NaicsCode":null,"NaicsDesc":null,"YearStarted":null,"SicDesc":null,"DandbCompanyId":null,"CustomerPriority__c":"Medium","SLA__c":"Silver","Active__c":"Yes","NumberofLocations__c":2,"UpsellOpportunity__c":"Maybe","SLASerialNumber__c":"2657","SLAExpirationDate__c":"2016-09-12"},{"attributes":{"type":"Account","url":"/services/data/v58.0/sobjects/Account/001B000000UnQ31IAF"},"Id":"001B000000UnQ31IAF","IsDeleted":false,"MasterRecordId":null,"Name":"Express Logistics and Transport","Type":"Customer - Channel","ParentId":null,"BillingStreet":"620 SW 5th Avenue Suite 400\nPortland, Oregon 97204\nUnited States","BillingCity":"Portland","BillingState":"OR","BillingPostalCode":null,"BillingCountry":null,"BillingLatitude":null,"BillingLongitude":null,"BillingGeocodeAccuracy":null,"BillingAddress":{"city":"Portland","country":null,"geocodeAccuracy":null,"latitude":null,"longitude":null,"postalCode":null,"state":"OR","street":"620 SW 5th Avenue Suite 400\nPortland, Oregon 97204\nUnited States"},"ShippingStreet":"620 SW 5th Avenue Suite 400\nPortland, Oregon 97204\nUnited States","ShippingCity":null,"ShippingState":null,"ShippingPostalCode":null,"ShippingCountry":null,"ShippingLatitude":null,"ShippingLongitude":null,"ShippingGeocodeAccuracy":null,"ShippingAddress":{"city":null,"country":null,"geocodeAccuracy":null,"latitude":null,"longitude":null,"postalCode":null,"state":null,"street":"620 SW 5th Avenue Suite 400\nPortland, Oregon 97204\nUnited States"},"Phone":"(503) 421-7800","Fax":"(503) 421-7801","AccountNumber":"CC947211","Website":"www.expressl\u0026t.net","PhotoUrl":"/services/images/photo/001B000000UnQ31IAF","Sic":"8742","Industry":"Transportation","AnnualRevenue":950000000,"NumberOfEmployees":12300,"Ownership":"Public","TickerSymbol":"EXLT","Description":"Commerical logistics and transportation company.","Rating":"Cold","Site":null,"OwnerId":"005B0000003TOI6IAO","CreatedDate":"2017-08-18T14:46:22.000+0000","CreatedById":"005B0000003TOI6IAO","LastModifiedDate":"2017-08-18T14:46:22.000+0000","LastModifiedById":"005B0000003TOI6IAO","SystemModstamp":"2017-08-18T14:46:22.000+0000","LastActivityDate":null,"LastViewedDate":null,"LastReferencedDate":null,"IsPartner":false,"IsCustomerPortal":false,"ChannelProgramName":null,"ChannelProgramLevelName":null,"Jigsaw":null,"JigsawCompanyId":null,"CleanStatus":"Pending","AccountSource":null,"DunsNumber":null,"Tradestyle":null,"NaicsCode":null,"NaicsDesc":null,"YearStarted":null,"SicDesc":null,"DandbCompanyId":null,"CustomerPriority__c":"Medium","SLA__c":"Platinum","Active__c":"Yes","NumberofLocations__c":150,"UpsellOpportunity__c":"Maybe","SLASerialNumber__c":"4724","SLAExpirationDate__c":"2017-03-15"},{"attributes":{"type":"Account","url":"/services/data/v58.0/sobjects/Account/001B000000UnQ35IAF"},"Id":"001B000000UnQ35IAF","IsDeleted":false,"MasterRecordId":null,"Name":"GenePoint","Type":"Customer - Channel","ParentId":null,"BillingStreet":"345 Shoreline Park\nMountain View, CA 94043\nUSA","BillingCity":"Mountain View","BillingState":"CA","BillingPostalCode":null,"BillingCountry":null,"BillingLatitude":null,"BillingLongitude":null,"BillingGeocodeAccuracy":null,"BillingAddress":{"city":"Mountain View","country":null,"geocodeAccuracy":null,"latitude":null,"longitude":null,"postalCode":null,"state":"CA","street":"345 Shoreline Park\nMountain View, CA 94043\nUSA"},"ShippingStreet":"345 Shoreline Park\nMountain View, CA 94043\nUSA","ShippingCity":null,"ShippingState":null,"ShippingPostalCode":null,"ShippingCountry":null,"ShippingLatitude":null,"ShippingLongitude":null,"ShippingGeocodeAccuracy":null,"ShippingAddress":{"city":null,"country":null,"geocodeAccuracy":null,"latitude":null,"longitude":null,"postalCode":null,"state":null,"street":"345 Shoreline Park\nMountain View, CA 94043\nUSA"},"Phone":"(650) 867-3450","Fax":"(650) 867-9895","AccountNumber":"CC978213","Website":"www.genepoint.com","PhotoUrl":"/services/images/photo/001B000000UnQ35IAF","Sic":"3712","Industry":"Biotechnology","AnnualRevenue":30000000,"NumberOfEmployees":265,"Ownership":"Private","TickerSymbol":null,"Description":"Genomics company engaged in mapping and sequencing of the human genome and developing gene-based drugs","Rating":"Cold","Site":null,"OwnerId":"005B0000003TOI6IAO","CreatedDate":"2017-08-18T14:46:22.000+0000","CreatedById":"005B0000003TOI6IAO","LastModifiedDate":"2017-08-18T14:46:22.000+0000","LastModifiedById":"005B0000003TOI6IAO","SystemModstamp":"2017-08-18T14:46:22.000+0000","LastActivityDate":null,"LastViewedDate":null,"LastReferencedDate":null,"IsPartner":false,"IsCustomerPortal":false,"ChannelProgramName":null,"ChannelProgramLevelName":null,"Jigsaw":null,"JigsawCompanyId":null,"CleanStatus":"Pending","AccountSource":null,"DunsNumber":null,"Tradestyle":null,"NaicsCode":null,"NaicsDesc":null,"YearStarted":null,"SicDesc":null,"DandbCompanyId":null,"CustomerPriority__c":"Low","SLA__c":"Bronze","Active__c":"Yes","NumberofLocations__c":1,"UpsellOpportunity__c":"Yes","SLASerialNumber__c":"7324","SLAExpirationDate__c":"2017-03-15"}]}