API Documentation

Sample Code Downloads

Provided are sample projects that call a few of the APIs as examples to show how the OAuth2 protocol works and how a few of the REST calls would be called. Samples provided in C# and Java.

C# Command-line Sample

The purpose of the command-line sample app is to show examples of various API calls including the initial OAuth2 authentication call. This type of application would not support SSO-based authentication, so would be the basis of an application typically used by administrator, not by a typical corporate user.

  • Download the C# sample
  • Extract the .zip file to a preferred folder
  • Open .sln file with Visual Studio
  • Follow the instructions in Getting Started guide to define an app in the developer portal. The app key and app secret values are found in the developer portal application page. The Syncplicity admin token is found on the "My Account" page of the Syncplicity administration page. See the "Application Token" field on that page to generate a token.
  • Update the application key values in the app.config:
    • Update the consumer key value (REPLACE_WITH_APP_KEY)
    • Update the consumer secret (REPLACE_WITH_APP_SECRET)
    • Update the Syncplicity admin token (REPLACE_WITH_ADMIN_TOKEN). There are two placeholders for two ROLs (1 and 2), if you don't know exactly the number of your user home ROL, put the admin token into both placeholders
    • Update the owner Email (REPLACE_OWNER_EMAIL)
  • Compile and Run

Sample application has 3 example suites (use-cases):

  • Provisioning: users and groups creation;
  • Content: folders creation, file upload and download;
  • CrossRol: example of requests when user has data in foreign region

Every suite, except common settings described above, also needs its own setting values to be defined. If you are not interested in running some suites, you can skip configuration of their settings and just comment out the lines which run these suites in the Program.cs file.

Java Command-line Sample

The purpose of the command-line sample app is to show examples of various API calls including the initial OAuth2 call. This type of application would not support SSO-based authentication, so would be the basis of an application typically used by administrator, not by a typical corporate user.

  • Download the Java sample
  • Use Eclipse or similar Java IDE to open the .project files provided in the sub-directories
  • Follow the instructions in Getting Started guide to define an app in the developer portal. The app key and app secret values are found in the developer portal application page. The Syncplicity admin token is found on the "My Account" page of the Syncplicity administration page. See the "Application Token" field on that page to generate a token.
  • Update key values in java\com\syncplicity\api\samples\commonesources\config.properties:
    • Update the the consumer key value (REPLACE_WITH_APP_KEY)
    • Update the consumer secret (REPLACE_WITH_APP_SECRET)
    • Update the Syncplicity admin token (REPLACE_WITH_ADMIN_TOKEN)
    • Update the EE account owner email, typically the sandbox owner email for development purposes (REPLACE_OWNER_EMAIL_OF_SANDBOX_EE_ACCOUNT)
  • Compile and Run

Active Directory Integration Sample Using Java

This sample app is similar to the Java command-line sample app but has been extended to show how a developer might invoke various APIs against Active Directory (AD) to provision users and assign those users to various user groups based on the metadata that is configured inside AD.

  • Download the Java AD sample
  • Use Eclipse or similar Java IDE to open the .project files provided in the sub-directories
  • Follow the instructions in Getting Started guide to define an app in the developer portal. The app key and app secret values are found in the developer portal application page. The Syncplicity admin token is found on the "My Account" page of the Syncplicity administration page. See the "Application Token" field on that page to generate a token.
  • Update key values in java\com\syncplicity\api\samples\commonesources\config.properties:
    • Update the consumer key value (REPLACE_WITH_APP_KEY)
    • Update the consumer secret (REPLACE_WITH_APP_SECRET)
    • Update the Syncplicity admin token (REPLACE_WITH_ADMIN_TOKEN)
    • Update the EE account owner email, typically the sandbox owner email for development purposes (REPLACE_OWNER_EMAIL_OF_SANDBOX_EE_ACCOUNT)
    • Update the active directory url (adUrl) so that the sample app can locate the AD server
    • Update the active directory login id. This will be the user that the application uses to query the active directory (queryUserBaseDN)
    • Update the active directory password for the above user (queryUserPassword).
    • Update the active directory permission search level [search base]. (querySearchBase)
  • Compile and Run