API / use of ExternalSyncIdentifier field

New post

Comments

1 comment

  • jcleblanc

    Hi ,

     

    The ExternalSyncIdentifier field is just some arbitrary identifier that you can set on the group to help you maintain syncing services between some external group that you may have.

     

    With that said, let me add some sample code that might help determine what is going on here - I'll use the Java SDK for these.

     

    First, let's say we created a group and want to now set the externalSyncIdentifier field. I would do something like the following to set the field then update the group:

     

    String groupID = "4353453454";
    BoxGroup group = new BoxGroup(client, groupID);
    BoxGroup.Info groupInfo = group.getInfo();
    groupInfo.setExternalSyncIdentifier("GroupID123");
    group.updateInfo(groupInfo);

     

    Next, let's say I want to fetch the ExternalSyncIdentifier on a group. That field is not returned back in the standard groupInfo object, and needs to be specifically requested in the fields param sent to the API. In the Java SDK if I wanted to fetch that field plus the group ID and name, I would do something like this:

     

    String groupID = "4353453454";
    BoxGroup.Info groupInfo = new BoxGroup(client, groupID).getInfo("id", "name", "external_sync_identifier");
    System.out.println(groupInfo.getExternalSyncIdentifier());

     

    I hope that helps, but please let me know if any of the above doesn't solve your issue.

     

    - Jon

    0
    Comment actions Permalink

Please sign in to leave a comment.