Shows examples of various API calls including the initial OAuth2 call.
This sample application demonstrates various API calls including the initial OAuth2 authentication call. This is a CLI application that does not support SSO-based authentication, so would be the basis of an application typically used by administrator, not by a regular Syncplicity user.
- OS: Windows 7+
- .NET Framework: 4.5+
- Visual Studio: 2015+ (any edition)
This sample application demonstrates usage of Syncplicity APIs. This is what you need to know or do before you begin to use Syncplicity APIs:
- Make sure you have an Enterprise Edition account you can use to login to the Developer Portal at https://developer.syncplicity.com.
- Log into Syncplicity Developer Portal using your Syncplicity login credentials.
Only Syncplicity Enterprise Edition users are allowed to login to the Developer Portal.
Based on the configuration done by your Syncplicity administrator,
Syncplicity Developer Portal will present one of the following options for login:
- Basic Authentication using Syncplicity username and password.
- Enterprise Single Sign-on using the web SSO service used by your organization. We support ADFS, OneLogin, Ping and Okta.
- Once you have successfully logged in for the first time,
you must create an Enterprise Edition sandbox account in the Developer Portal.
This account can be used to safely test your application using all Syncplicity features
without affecting your company production data.
- Log into Syncplicity Developer Portal. Click 'My Profile' and then 'Create sandbox'. Refer to the documentation for guidance: https://developer.syncplicity.com/documentation/overview.
- You can log into https://my.syncplicity.com using the sandbox account. Note that the sandbox account email has "-apidev" suffix. So, assuming you regular account email is firstname.lastname@example.org, use email@example.com email address to log in to your sandbox account.
- Setup your developer sandbox account:
- Review API documentation by visiting documentation section on the https://developer.syncplicity.com.
- Register you application in the Developer Portal to obtain the "App Key" and "App Secret".
- Clone the sample project.
- Use your favorite .NET IDE to open the
- Define new application on https://developer.syncplicity.com. The app key and app secret values are found in the application page. The Syncplicity admin token is found on the "My Account" page of the Syncplicity administration page. Use the "Application Token" field on that page to generate a token.
- Update key values in
- Update the the app key (
- Update the app secret (
- Update the Syncplicity admin token (
- Update the owner email, typically the sandbox owner email for development purposes (
- Update the the app key (
- Build the solution.
- Run the application.
Storage Vault Authentication Sample
Note: This is an advanced concept. If your company does not use the SVA, you don't need to study it. Learn more about SVA.
Working with Storage Vaults protected with SVA requires additional authentication procedures. To run SVA sample:
- Obtain Storage Token, Machine Id and Machine Token used to authenticate calls to Storage Vault. Follow the 'Setup Procedure' of the Content Migration Guide to get those.
- Configure the sample (
- Set Storage Token value (
- Set Machine Token value (
- Set Machine Id value (
- Set Storage Token value (
- Build and run the sample application
Running On-Behalf-Of sample (As User)
The On Behalf Of sample demonstrates how an administrator can execute actions on behalf of other users (impersonating other users). Running the On Behalf Of sample requires additional configuration.
You need to specify the email of the impersonated user in the
asUserEmail parameter in
Besides, the owner of the Application Token must have permissions to execute code on behalf of other users. By default, Global Administrators do not have this permission. To grant this permission:
- There must be at least two Global Administrator users in the company.
- One administrator must sign into Syncplicity (https://my.syncplicity.com)
- Go to the Admin area, User Accounts
- Find the other administrator account
- Under "Privileges", click "Modify", select "Access content on behalf of managed users through API" and click "Save"
- Confirm notification of all administrators about the action
Once this is done, the second administrator account can use the
As User parameter.
Running Legal Hold sample
The Legal Hold sample demonstrates how an administrator with eDiscovery role can put a user on legal hold and then retrieve the user's content even permanently deleted one. Running the Legal Hold sample requires additional configuration.
You need to specify next parameters in
- eDiscovery administrator application token in the
eDiscoveryAdminTokenparameter. Note: the eDiscovery administrator must have permissions to access content on behalf of managed users and data custodian user must belong to a group of such users.
- Data custodian user email in the
- Data custodian user application token in the
dataCustodianUserTokenparameter. Note: the data custodian user must be an admin to generate application token.
Debugging with Fiddler
To debug the sample application with Fiddler, one needs to make Fiddler SSL certificates trusted by the application. The easiest way is by adding Fiddler's certificate to Trusted Root CA list. To do this in Fiddler, go to Tools -> Options -> HTTPS -> Actions -> Trust Root Certificate. Accept Fiddler warnings, reading carefully what they say.
Apache License 2.0