Search code examples
phpbox-apiboxapiv2

How do I set a box link to never expire via the content API?


I need to set a box link to never expire.

The API guide doesn't describe how to do this: https://box-content.readme.io/reference#create-a-shared-link-for-a-folder

I've opened a request on the box communities page, but I'm hoping someone here might know and save me the wait!

I have tried sending both 'NULL' and blank string '' in the field "unshared_at".

NULL just defaulted to the standard date. Blank string failed entirely.


Solution

  • It transpires that PHP was not encoding a null value for 'unshared_at'. If you do successfully send a null, it works just fine.

    This works:

    {"shared_link": {
            "access": "company",
            "unshared_at": null
    }}