Back to Collection Items
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
DECLARE @iTmp0 int
-- Important: Do not use nvarchar(max). See the warning about using nvarchar(max).
DECLARE @sTmp0 nvarchar(4000)
-- This example assumes the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
DECLARE @http int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Http', @http OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
DECLARE @success int
DECLARE @queryParams int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonObject', @queryParams OUT
EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'searchKey', 'my'
EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'usageType', 'Bre'
EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'lookupTypes', 'DecisionTable'
-- Adds the "Authorization: Bearer <access_token>" header.
EXEC sp_OASetProperty @http, 'AuthToken', '<access_token>'
DECLARE @resp int
EXEC sp_OAMethod @http, 'QuickRequestParams', @resp OUT, 'GET', 'https://domain.com/services/data/v{{version}}/connect/business-rules/lookup-tables', @queryParams
EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
IF @iTmp0 = 0
BEGIN
EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @queryParams
RETURN
END
EXEC sp_OAGetProperty @resp, 'StatusCode', @iTmp0 OUT
PRINT @iTmp0
EXEC sp_OAGetProperty @resp, 'BodyStr', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @resp
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @queryParams
END
GO
Curl Command
curl -G -d "searchKey=my"
-d "usageType=Bre"
-d "lookupTypes=DecisionTable"
-H "Authorization: Bearer <access_token>"
https://domain.com/services/data/v{{version}}/connect/business-rules/lookup-tables
Postman Collection Item JSON
{
"name": "Retrieve lookup tables",
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/connect/business-rules/lookup-tables?searchKey=my&usageType=Bre&lookupTypes=DecisionTable",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"connect",
"business-rules",
"lookup-tables"
],
"query": [
{
"key": "searchKey",
"value": "my"
},
{
"key": "usageType",
"value": "Bre"
},
{
"key": "lookupTypes",
"value": "DecisionTable",
"description": "Optional: Type of lookup table. Valid values are: DecisionMatrix, DecisionTable"
}
]
},
"description": "# Lookup Tables (GET)\n\nRetrieve lookup tables.Resource\n\n```\n/connect/business-rules/lookup-tables\n\n ```\n\nResource example\n\n```\nhttps://yourInstance.salesforce.com/services/data/v59.0/connect/business-rules/lookup-tables?searchKey=D&usageType=Bre&lookupTypes=DecisionTable,DecisionMatrix\n\n ```\n\n```\nhttps://yourInstance.salesforce.com/services/data/v59.0/connect/business-rules/lookup-tables?searchKey=D&usageType=Bre\n\n ```\n\nAvailable version59.0Requires ChatterNoHTTP methodsGETRequest parameters for GET\n\n| Parameter Name | Type | Description | Required or Optional | Available Version |\n| --- | --- | --- | --- | --- |\n| lookupTypes | String | Type of lookup table. Valid values are:<br><br>- DecisionMatrix<br> <br>- DecisionTable | Optional | 59.0 |\n| searchKey | String | The search text entered by the user to retrieve a list of lookup tables. | Required | 59.0 |\n| usageType | String | Usage type of the lookup table. Valid values are:<br><br>- AiAcceleratorSubscriberChurnPrediction—Used for Industries Einstein<br> <br>- Bre—Used for Business Rules Engine<br> <br>- CustomLoyalty—Used for Loyalty Management<br> <br>- DefaultPricing—Used for Pricing Plans in Enterprise Product Catalog (EPC) by Communications Cloud<br> <br>- Qualification—Used for Industries Communications, Media, and Energy (CME)<br> <br>- RecordAlert—Used for Financial Services Cloud<br> <br>- ShipAndDebit—Used for Manufacturing Cloud<br> <br>- TierProcessing—Used for Loyalty Management<br> <br>- TransactionJournal—Used for Loyalty Management<br> <br>- WarrantyClaim—Used for Manufacturing Cloud | Required | 59.0 |\n\nResponse body for GET[Lookup Tables Result List](https://developer.salesforce.com/docs/atlas.en-us.industries_reference.meta/industries_reference/connect_responses_lookup_tables_result_list.htm)"
},
"response": [
{
"name": "404-BecauseVersion59.0NotPresentInTargetOrg",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{_endpoint}}/services/data/v{{version}}/connect/business-rules/lookup-tables?searchKey=my&usageType=Bre&lookupTypes=DecisionTable",
"host": [
"{{_endpoint}}"
],
"path": [
"services",
"data",
"v{{version}}",
"connect",
"business-rules",
"lookup-tables"
],
"query": [
{
"key": "searchKey",
"value": "my"
},
{
"key": "usageType",
"value": "Bre"
},
{
"key": "lookupTypes",
"value": "DecisionTable",
"description": "Optional: Type of lookup table. Valid values are: DecisionMatrix, DecisionTable"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Date",
"value": "Wed, 06 Sep 2023 08:56:11 GMT"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=63072000; includeSubDomains"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "X-Robots-Tag",
"value": "none"
},
{
"key": "Cache-Control",
"value": "no-cache,must-revalidate,max-age=0,no-store,private"
},
{
"key": "Content-Type",
"value": "application/json;charset=UTF-8"
},
{
"key": "Transfer-Encoding",
"value": "chunked"
}
],
"cookie": [
],
"body": "[\n {\n \"errorCode\": \"NOT_FOUND\",\n \"message\": \"The requested resource does not exist\"\n }\n]"
}
]
}