Level up your Box knowledge with brand new learning paths on Box University. Visit training.box.com to get started

Box PATCH users API - Unable to post the tracking_codes configuration

New post

Comments

4 comments

  • mikeporterinmd

    Same problem here.  Anyone ever get this to work?

     

    Mike

    0
    Comment actions Permalink
  • Kourtney

     The use of tracking codes must be enabled by your customer success manager as noted here: https://community.box.com/t5/How-to-Guides-for-Admins/Configuring-User-Tracking-Codes/ta-p/235. Have you done this? 

    0
    Comment actions Permalink
  • mikeporterinmd

    Hi,

     

    Yes, I heard back from tech support.  I didn't know that after tracking codes are enabled, a new setting appears and you have to define which codes you will accept.  Since the actual structure of what needs to be passed is not documented anywhere I could find, I will post what works for me:

     

    upd[ 'tracking_codes' ] = [
        {
            'type': 'tracking_code',
            'name': 'ACode',
            'value': value
        }
    ]

     

    The above example is Python.  The 'ACode' value needs to be defined in the admin interface.  'upd' is a dict and in this case is the dictionary passed to the update call for a user.  For adding users, just pass the list using the tracking_codes keyword.  The JSON serializer in the API will convert the above to the appropriate text for the POST.

     

    This is the curl command tech support sent me:

     

    -H "Authorization: Bearer {{AccessToken}}" \
    -d '{"tracking_codes":[{"type":"tracking_code","name":"employee_id","value":"123123123"}]}' \
    -X PUT
     
    Thanks,
     
    Mike
    0
    Comment actions Permalink
  • mikeporterinmd

    Where to find the settings for tracking codes:

     

    "Prior to that call being successful, you'll have to set up tracking code definitions in the admin console > enterprise settings > user settings > user tracking codes. In this case, it would be "employee_id"

     

    (Box tech support)

     

    Mike

    0
    Comment actions Permalink

Please sign in to leave a comment.