Giter Site home page Giter Site logo

linx-software / salesforce-api-connectors Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 775 KB

Pre-built connector functions to integrate with the Salesforce REST API.

Home Page: https://linx.software/

salesforce salesforce-api low-code low-code-development-platform salesforce-developers salesforce-rest-api

salesforce-api-connectors's Introduction

salesforce-api-connectors

Description

This sample contains multiple pre-built Linx functions which allow you to quickly connect and make HTTP requests the Salesforce REST API. These 'connector' functions have been built and tested to handle to the specifics of interacting with the various Salesforce API methods and objects. You can copy and use these functions in your own Linx Solution to accelerate development.

The goal of this Linx Solution is to ultimately include custom built connector functions for all the methods of the Salesforce REST API.

Installation

Retrieving your instance URL:

Requests made to the Salesforce API must use a unique URL which is based on their instance name. This name needs to be retrieved using the Identity Url from Salesforce. This identity url can be retrieved by querying for user info with the access token string.

  1. Install the Linx Designer. Download it here.

  2. Open the sample Solution '.lsoz' in your Linx Designer.

  3. Open the Solution's settings and add your Salesforce instance name. For example, if my Salesforce instance URL is https:/linx-dev-ed.salesforce.com/ then my instance name is "linx-dev-ed".

    A function GetIdentity has been included in the sample to retrieve this information if you already posses your access token, see below for info on access generation..

Access token generation

Authentication of requests is achieved via access tokens, the functions take in the "access token" used in the request as an input parameter at runtime, which is then added to the header of the request.

This "access token" needs to be passed in to each function by you, this could be retrieved from a database, file or external service.

You're able to generate and retrieve your token from an external authentication service or, alternatively, you're able to host your own Linx authentication service with the linx-oauth-token-service project on GitHub.

Using the connector functions

This sample contains generic "connector" functions which can be imported and used in your own Linx Solution.

Each connector function in the Solution follows the below structure:

  • Takes in an "access token" value as an input parameter.
  • Takes in any data used for the request parameters such as query, path or requestBody values.
  • Makes a HTTP request to the API and returns a string response.
  • The response string is then de-serialized into the function result object type.

These functions do not persist any data and only return or send data that is received at runtime, therefore you must add your own data persistence layer if required.

Testing the connectors

An automated testing function has been included in each sub-sections of the Solution Explorer within the sample Solution to test the relevant functionality. For example the 'Accounts' section contains all the neccessary methods for interacting with the 'Account' object on the Salesforce API.

To test out an area's functionality:

  1. Located the Test folder of the sub-sections of in the Solution (i.e. Accounts > Tests).
  2. Initalize the debugger on the TestAllXXXRequests functions (i.e. TestAllAccountRequests).
  3. Add your access token as an input parameter.
  4. Start the debugger.
  5. The function executes the following requests with test data (i.e TestAllAccountRequests):
    • Creates a new account
    • Retrieves the details of the new account
    • Retrieves a list of all of the accounts
    • Loops through the account list
    • Updates the relevant account
  6. When the function completes, a test object will have been created and updated on the Salesforce API.

Importing the connector functions into your own Solution

  1. Right-click on the SalesforceAPI folder in the Solution Explorer.
  2. Select Copy.
  3. Open your own Solution.
  4. Right-click on your Solution Explorer and click Paste.
  5. A validation error will occur referencing the missing setting values.
  6. Copy and paste the setting names and values from the Sample solution into your own Solution.
  7. The validation messages will dissapear and you can now drag the required connector functions into your own custom functions.

Contributing

For questions and issues please ask the Linx community or use the Slack channel.

If you have any specific requests for sObjects that have not yet been implemented, get in touch with [email protected].

License

MIT

salesforce-api-connectors's People

Contributors

gawie-yssel avatar ronanaw avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.