Homepage | Products | OX Knowledge Base | Support | Try Now | Contact | Company
OX Logo
Results 1 to 3 of 3
  1. #1

    Default How to add categories programmatically?

    Hi OX hackers,

    I would like to add categories (with colors) via a computer program. For this I investigated the HTTP API. As far as I understand the documentation there is not proper API for this. From debugging the webclient I learned that categories are set via "PUT /ajax/config/gui" containing a string such as {"categories":{"local":[{"color":5,"name":"Private"},{"color":2,"name":"Bu siness"}]}.

    So my question is: Is calling the "PUT /ajax/config/gui" url the right place to add categories (with colors)? Is it sufficient to add just the categories string or must other content be provided in order to not change anything else?

    Thanks for your feedback.

    Best regards,
    Thomas

  2. #2
    Join Date
    Feb 2007
    Posts
    253

    Default

    As far as the HTTP API is concerned, all categories are just comma-separated strings in field 100 of each object. The assignment of colors is done purely by the GUI, and the set of defined categories is stored in the GUI-specific configuration of each user, as you already found out.

    The entire GUI configuration is stored as one big JSON object, so if the users already logged in and may have made changes to their configuration, then you have to first retrieve it with a GET request, parse the JSON object, make the modifications you need, and then upload the modified JSON object with a PUT request. You can do this either via the HTTP API or using command line tools.

    When provisioning new users, there is no JSON object to parse, so you can just upload a new object containing only the "categories" field.

  3. #3

    Default

    Thank you very much for your detailed answer! This was exactly I was looking for!

    Thomas

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •