Chilkat Online Tools

Android / Salesforce Platform APIs / Retrieve lookup tables

Back to Collection Items

// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;

import android.app.Activity;
import com.chilkatsoft.*;

import android.widget.TextView;
import android.os.Bundle;

public class SimpleActivity extends Activity {

  private static final String TAG = "Chilkat";

  // Called when the activity is first created.
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkHttp http = new CkHttp();
    boolean success;

    CkJsonObject queryParams = new CkJsonObject();
    queryParams.UpdateString("searchKey","my");
    queryParams.UpdateString("usageType","Bre");
    queryParams.UpdateString("lookupTypes","DecisionTable");

    // Adds the "Authorization: Bearer <access_token>" header.
    http.put_AuthToken("<access_token>");

    CkHttpResponse resp = http.QuickRequestParams("GET","https://domain.com/services/data/v{{version}}/connect/business-rules/lookup-tables",queryParams);
    if (http.get_LastMethodSuccess() == false) {
        Log.i(TAG, http.lastErrorText());
        return;
        }

    Log.i(TAG, String.valueOf(resp.get_StatusCode()));
    Log.i(TAG, resp.bodyStr());


  }

  static {
      System.loadLibrary("chilkat");

      // Note: If the incorrect library name is passed to System.loadLibrary,
      // then you will see the following error message at application startup:
      //"The application <your-application-name> has stopped unexpectedly. Please try again."
  }
}

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>- AiAccelerator​SubscriberChurn​Prediction—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]"
    }
  ]
}