Inconsistent Response for Controls API Endpoint

I am querying the following API endpoint:

https://coda.io/apis/v1/docs/{docId}/controls/{controlId}

I am getting very inconsistent responses even though i am querying an existing doc (checked) and existing controls (checked as well).

  • Querying a Date Control is successful:

    {
    
    "id": "ctrl-TUzm5g_QHF",
    
    "type": "control",
    
    "href": "https://coda.io/apis/v1/docs/nqW7y8-J2p/controls/ctrl-TUzm5g_QHF",
    
    "name": "vendorInvoiceDate",
    
    "controlType": "datePicker",
    
    "value": "2022-09-13T13:00:00.000-07:00"
    
    }
    
  • Querying a Select Control returns an empty Value string despite an actual value in the doc:

    {
    
    "id": "ctrl-QiBpDgf5Ec",
    
    "type": "control",
    
    "href": "https://coda.io/apis/v1/docs/nqW7y8-J2p/controls/ctrl-QiBpDgf5Ec",
    
    "name": "vendorInvoiceCurrency",
    
    "controlType": "select",
    
    "value": ""
    
    }
    
  • Querying a Text Control returns a plain 501 - Not Implemented - error

Looks like a bug to me… Anyone, Any Idea ?

Thanks

Hi @Laurent_Ades - Thanks for raising this. The inconsistent values you are seeing are likely due to the controls being set to “Personal” instead of “Collaborative”. Personal is the default for new controls, but it stores a unique value per-user. While the browser gives you a personal view of the document, the API returns data outside of the context of any particular user.

As for the 501 error, that does appear to be a bug. I’ll file that with our engineering team.

1 Like

Thanks @Eric_Koleda for the hint on Personal/Collaborative control setting. Working as expected now.
Looking forward to the resolution on the Text Control.
Thanks

@Laurent_Ades We just added support for Textbox control output, it should go live on Thursday. Thanks for the report!

3 Likes

I confirm this is now working as expected. Great job!
Thanks

1 Like