Ballerina · Example Payload

Central Api Connector Search Response Example

IntegrationOrchestrationOpen SourceProgramming LanguagePackage RegistryDeveloper ToolsCode GenerationAgent Skills

Central Api Connector Search Response Example is an example object payload from Ballerina, with 4 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

connectorscountoffsetlimit

Example Payload

Raw ↑
{
  "connectors": [
    {
      "id": 12076,
      "name": "Client",
      "displayName": "",
      "moduleName": "salesforce.bulkv2",
      "functions": null,
      "displayAnnotation": {},
      "package": {
        "id": 52679,
        "organization": "ballerinax",
        "name": "salesforce",
        "version": "8.7.0",
        "platform": "java21",
        "languageSpecificationVersion": "2024R1",
        "isDeprecated": false,
        "deprecateMessage": "",
        "URL": "/ballerinax/salesforce/8.7.0",
        "balaVersion": "3.0.0",
        "balaURL": "https://fileserver.central.ballerina.io/2.0/ballerinax/salesforce/8.7.0/ballerinax-salesforce-java21-8.7.0.bala?Expires=1788565362&Signature=KZHPtQOEzL4goFHKAleYt~P9AG4~f8CbvPr7Hb60HAB4zfOo9e2LigPaoOUer5iUWo0ZDKSLAhbk8k-Pr8mptRl8ef1SAVbeFYudWm20O2hmoyJbUp7-Ju2g0haLMxzu9KKKj35RW1asWw0~RH~6areb5aqdkzHZqb~MhIwmqhQwEOGJ7IW2GDYGWzoWVxZEu-vaeZNOB3jljPuoUvz9qnqMpqOZOvGxJA8eVnGnctTG3ZPxSiV34Qcsdsz4jQIKdg97TzaG68ByBhG1nwoY6lXLYCUlAsF7OCBQSEOYgFjrHxCNx99Z0kXJdbdy8W4IsnPG2cWCZmPaoJOfMYZXCA__&Key-Pair-Id=K27IQ7NPTKLKDU",
        "digest": "sha-256=2411ab7cc902394ad95b05254b6bed98b0bd30fc8287b724c8b7a571b34d760f",
        "summary": "Salesforce Sales Cloud is a leading Customer Relationship Management (CRM) software provided by Salesforce Inc. It enables users to efficiently manage sales and customer relationships through its APIs, robust and secure databases, and analytics services. Sales Cloud provides several API packages to perform operations on sObjects and metadata, execute queries and searches, and listen to change events through API calls using REST, SOAP, and CometD protocols.",
        "readme": "## Overview\n\nSalesforce Sales Cloud is a leading Customer Relationship Management (CRM) software provided by Salesforce Inc. It enables users to efficiently manage sales and customer relationships through its APIs, robust and secure databases, and analytics services. Sales Cloud provides several API packages to perform operations on sObjects and metadata, execute queries and searches, and listen to change events through API calls using REST, SOAP, and CometD protocols.\n\nThe Salesforce connector supports various Salesforce APIs including REST, SOAP, APEX REST, BULK, and BULK V2 APIs.\n\n### Key Features\n\n- Support for REST, SOAP, APEX REST, BULK, and BULK V2 APIs\n- Perform CRUD operations on sObjects and metadata\n- Execute complex queries and searches\n- Listen to real-time Change Data Capture events and Platform Events via CometD\n- Handle listener errors gracefully with an optional `onError` callback\n- Efficient management of large datasets using Bulk APIs\n\n## Setup guide\n\n1. Create a Salesforce account with the REST capability.\n\n2. Go to Setup --> Apps --> App Manager \n\n   <img src=https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-salesforce/master/docs/setup/resources/side-panel.png alt=\"Setup Side Panel\" style=\"border:1px solid #000000; width:40%\">\n\n3. Create a New Connected App.\n\n   <img src=https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-salesforce/master/docs/setup/resources/create-connected-apps.png alt=\"Create Connected Apps\" style=\"border:1px solid #000000; width:50%\">\n\n    - Here we will be using https://test.salesforce.com as we are using sandbox environment. Users can use https://login.salesforce.com for normal usage.\n\n    <img src=https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-salesforce/master/docs/setup/resources/create_connected%20_app.png alt=\"Create Connected Apps\" style=\"border:1px solid #000000; width:100%\">\n\n4. After the creation user can get consumer key and secret through clicking on the `Manage Consumer Details` button.\n\n   <img src=https://raw.githubusercontent.com/ballerina-platform/module-ballerinax-salesforce/master/docs/setup/resources/crdentials.png alt=\"Consumer Secrets\" style=\"border:1px solid #000000; width:100%\">\n\n5. Next step would be to get the token.\n    - Log in to salesforce in your preferred browser and enter the following url.\n  ```\n  https://<YOUR_INSTANCE>.salesforce.com/services/oauth2/authorize?response_type=code&client_id=<CONSUMER_KEY>&redirect_uri=<REDIRECT_URL>\n  ```\n   - Allow access if an alert pops up and the browser will be redirected to a Url like follows.\n  \n      ```\n      https://login.salesforce.com/?code=<ENCODED_CODE>\n      ```\n  \n   - The code can be obtained after decoding the encoded code\n\n6. Get Access and Refresh tokens\n   - Following request can be sent to obtain the tokens.\n   \n      ```\n      curl -X POST https://<YOUR_INSTANCE>.salesforce.com/services/oauth2/token?code=<CODE>&grant_type=authorization_code&client_id=<CONSUMER_KEY>&client_secret=<CONSUMER_SECRET>&redirect_uri=https://test.salesforce.com/\n      ``` \n   - Tokens can be obtained from the response.\n\n## Quickstart\n\nTo use the Salesforce connector in your Ballerina application, modify the .bal file as follows:\n\n#### Step 1: Import connector\n\nImport the `ballerinax/salesforce` package into the Ballerina project.\n\n```ballerina\nimport ballerinax/salesforce;\n```\n\n#### Step 2: Create a new connector instance\n\nCreate a `salesforce:ConnectionConfig` with the obtained OAuth2 tokens and initialize the connector with it.\n```ballerina\nsalesforce:ConnectionConfig config = {\n    baseUrl: baseUrl,\n    auth: {\n        clientId: clientId,\n        clientSecret: clientSecret,\n        refreshToken: refreshToken,\n        refreshUrl: refreshUrl\n    }\n};\n\nsalesforce:Client salesforce = check new (config);\n```\n\n#### Step 3: Invoke connector operation\n\n1. Now you can utilize the available operations. Note that they are in the form of remote operations.  \n\nFollowing is an example on how to create a record using the connector.\n\n  ```ballerina\n  salesforce:CreationResponse response = check \n      salesforce->create(\"Account\", {\n                          \"Name\": \"IT World\",\n                          \"BillingCity\": \"New York\"\n                          });\n\n  ```\n\n2. To integrate the Salesforce listener into your Ballerina application, update the .bal file as follows:\n\nCreate an instance of `salesforce:Listener` using your Salesforce username, password, security token, and subscribe channel name.\n\n```ballerina\nimport ballerinax/salesforce;\n\nsalesforce:ListenerConfig listenerConfig = {\n    auth: {\n        username: \"username\",\n        password: \"password\" + \"security token\"\n    }\n};\nlistener salesforce:Listener eventListener = new (listenerConfig);\n```\n\nImplement the listener’s remote functions and specify the channel name to be subscribed to as the service name.\n\n```ballerina\nimport ballerina/io;\nimport ballerinax/salesforce;\n\nsalesforce:ListenerConfig listenerConfig = {\n    auth: {\n        username: \"username\",\n        password: \"password\" + \"security token\"\n    }\n};\nlistener salesforce:Listener eventListener = new (listenerConfig);\n\nservice \"/data/ChangeEvents\" on eventListener {\n    remote function onCreate(salesforce:EventData payload) {\n        io:println(\"Created \" + payload.toString());\n    }\n\n    remote isolated function onUpdate(salesforce:EventData payload) {\n        io:println(\"Updated \" + payload.toString());\n    }\n\n    remote function onDelete(salesforce:EventData payload) {\n        io:println(\"Deleted \" + payload.toString());\n    }\n\n    remote function onRestore(salesforce:EventData payload) {\n        io:println(\"Restored \" + payload.toString());\n    }\n}\n```\n\n3. Optionally, add an `onError` remote function to handle errors from `onMessage`/`onCreate`/`onUpdate`/`onDelete`/`onRestore` or from failed CometD subscriptions:\n\n```ballerina\nimport ballerina/io;\nimport ballerina/log;\nimport ballerinax/salesforce;\n\nsalesforce:ListenerConfig listenerConfig = {\n    auth: {\n        clientId: \"<clientId>\",\n        clientSecret: \"<clientSecret>\",\n        refreshToken: \"<refreshToken>\",\n        refreshUrl: \"https://login.salesforce.com/services/oauth2/token\"\n    },\n    baseUrl: \"https://<instance>.salesforce.com\"\n};\nlistener salesforce:Listener eventListener = new (listenerConfig);\n\nservice \"/event/MyEvent__e\" on eventListener {\n    remote function onMessage(salesforce:PlatformEventsMessage message) returns error? {\n        io:println(\"Platform event received: \", message.payload);\n    }\n\n    remote function onError(error err) returns error? {\n        log:printError(\"Listener error\", 'error = err);\n    }\n}\n```\n\nThe `onError` callback is invoked in two situations:\n- When `onMessage` (or a CDC handler) returns an `error`\n- When the CometD subscription itself fails (e.g., stale replay ID)\n\nIf `onError` is not defined and a subscription failure occurs, `start()` returns the error directly.\n\n4. Integrate custom SObject types\n\nTo seamlessly integrate custom SObject types into your Ballerina project, you have the option to either generate a package using the Ballerina Open API tool or utilize the `ballerinax/salesforce.types` module. Follow the steps given [here](https://github.com/ballerina-platform/module-ballerinax-salesforce/blob/master/ballerina/modules/types/Module.md) based on your preferred approach.\n\n```ballerina\nimport ballerinax/salesforce.types;\n\npublic function main() returns error? {\n    types:AccountSObject accountRecord = {\n        Name: \"IT World\",\n        BillingCity: \"New York\"\n    };\n\n    salesforce:CreationResponse res = check salesforce->create(\"Account\", accountRecord);\n}\n```\n\n4. Use following command to compile and run the Ballerina program.\n\n```\nbal run\n````\n\n## Examples\n\nThe `salesforce` connector provides practical examples illustrating usage in various scenarios. Explore these examples below, covering use cases like creating sObjects, retrieving records, and executing bulk operations.\n\n1. [Salesforce REST API use cases](https://github.com/ballerina-platform/module-ballerinax-salesforce/tree/master/examples/rest_api_usecases) - How to employ REST API of Salesforce to carryout various tasks.\n\n2. [Salesforce Bulk API use cases](https://github.com/ballerina-platform/module-ballerinax-salesforce/tree/master/examples/bulk_api_usecases) - How to employ Bulk API of Salesforce to execute Bulk jobs.\n\n3. [Salesforce Bulk v2 API use cases](https://github.com/ballerina-platform/module-ballerinax-salesforce/tree/master/examples/bulkv2_api_usecases) - How to employ Bulk v2 API to execute an ingest job.\n\n4. [Salesforce APEX REST API use cases](https://github.com/ballerina-platform/module-ballerinax-salesforce/tree/master/examples/apex_rest_api_usecases) - How to employ APEX REST API to create a case in Salesforce.",
        "template": false,
        "licenses": [
          "Apache-2.0"
        ],
        "authors": [
          "Ballerina"
        ],
        "sourceCodeLocation": "https://github.com/ballerina-platform/module-ballerinax-salesforce",
        "keywords": [
          "Cost/Freemium",
          "Vendor/Salesforce",
          "Area/CRM & Sales",
          "Type/Connector",
          "Type/Trigger"
        ],
        "ballerinaVersion": "2201.12.0",
        "icon": "https://bcentral-packageicons.azureedge.net/images/ballerinax_salesforce_8.7.0.png",
        "ownerUUID": "b5a9e54d-8ade-47a1-8abc-6bc46e89069d",
        "createdDate": 1780917855000,
        "pullCount": 106002,
        "visibility": "public",
        "modules": [],
        "balToolId": "",
        "graalvmCompatible": "Unknown"
      },
      "icon": "https://bcentral-packageicons.azureedge.net/images/ballerinax_salesforce_8.7.0.png"
    }
  ],
  "count": 8,
  "offset": 0,
  "limit": 1
}

Work with this as data

Every example here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for examples

4 MCP tools reach this
  • find_examplesBrowse and filter every example in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This example
curl "https://apis.io/api/v1/examples/central-api-connector-search-response-example"
All examples
curl "https://apis.io/api/v1/examples?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.