This is a Java example code for using ForceManager RESTful API. Click here to see the API documentation .
This example is written in Java using Spring Resttemplate, Jackson and Maven.
Follow these steps to get started:
You need to download the last version of Eclipse IDE for Java EE Developers, for example Lunar version. Make sure that Eclipse has installed the Maven plugin.
To import an existing Maven project into Eclipse, just right-click the Package Explorer and go to:
Import... > Existing Maven Projects > Select root directory > Finish
It's possible that you need to update Maven project. To do it, just right-click the project and go to:
Maven > Update Project...
Before running the examples, you need to add the public key and private key. To inform them, navigate to the file src\main\resources\fm-prop.properties
and change the value of these properties: net.forcemanager.ws.sample.publicKey
and net.forcemanager.ws.sample.privateKey
.
The package net.forcemanager.ws.sample.examples
contains some Java examples. Each example contains a Main class with a public static main method entry point.
This example shows the top 500 companies and prints their names by console.
In this example:
- First, add a new company to FM.
- Then, modifies it: change "city_name", "mobile_phone" and "phone".
- Finally, deletes it if exists in FM.