Code Monkey home page Code Monkey logo

salesforce-datacom-api-java-client's Introduction

Salesforce Data.com Java REST API

================================

Think the REST API is awesome and powerful, but maybe a bit overwhelming? This native Java implementation aims to keep the implementation simple while keeping all the power at your fingertips.

Overview

This Java REST API is a simple library to interact with the REST API.

Usage

Simply clone the salesforce-datacom-api-java-client project and incorporate it into your project.

Compiling the source is easy using maven:

mvn clean install

The jar file can be found at target/salesforce-datacom-api-java-client-xx.xx.jar.

Features

  • Contact get
  • Contact purchase
  • Contact search

Configuration and authentication

The Java REST API supports only one forms of authentication.

Username and password

If your org allows it (grant_type=password), you can use the client ID, client Secret and your username and password to authenticate. This is discouraged and the ClientSecret authentication is preferred over this one.

Example of a configuration file/class to be used with Password authentication

private static final Map<String, String> config = new HashMap<String, String>(){
    {
        put("grant_type", "password");

        put("username", "[email protected]");
        put("password", "myPassword");
        put("client_id", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
        put("x-ddc-client-id", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
    }
};

Examples

You can find loads of practical examples in the test/integration/src/ folder under the com.salesforce.package. For example: TestPost.java

Contact get

A very simple example:

ServiceFactory factory = new ServiceFactoryImpl(config);

ContactService service = factory.createContactService();
List<Contact> contacts = service.get(Arrays.asList(17892515L));

or

ContactService service = new ContactServiceImpl(config);
List<Contact> contacts = service.get(Arrays.asList(17892515L));

This contains almost all information you need.

Contact purchase

A very simple example:

ServiceFactory factory = new ServiceFactoryImpl(config);

ContactService service = factory.createContactService();
List<Contact> contacts = service.purchase(Arrays.asList(17892515L));

or

ContactService service = new ContactServiceImpl(config);
List<Contact> contacts = service.purchase(Arrays.asList(17892515L));

This contains almost all information you need.

Contact search

A very simple example:

ServiceFactory factory = new ServiceFactoryImpl(config);

ContactService service = factory.createContactService();

ContactQuery query = new ContactQuery();
query.setLastName("Ashley");
        
SearchContacts contacts = service.search(query);

or

ContactService service = new ContactServiceImpl(config);

ContactQuery query = new ContactQuery();
query.setLastName("Ashley");
        
SearchContacts contacts = service.search(query);

This contains almost all information you need.

License

The BSD 2-Clause License

http://opensource.org/licenses/BSD-2-Clause

See LICENSE.txt

githalytics.com alpha

salesforce-datacom-api-java-client's People

Contributors

svc-scm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

salesforce-datacom-api-java-client's Issues

Only provides functionality for accessing "Contacts"

This library can only be used to access Contacts endpoints.

The URLS are hardcoded, and so is everything else. This whole package is tightly coupled with the default Contacts salesforce setup, without support for other default SObjects or even custom fields on the Contacts endpoint.

Where is the rest of salesforce?

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.