Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Need more information about the API #1520

Open
boddedo opened this issue Jan 2, 2025 · 1 comment
Open

[Question] Need more information about the API #1520

boddedo opened this issue Jan 2, 2025 · 1 comment

Comments

@boddedo
Copy link

boddedo commented Jan 2, 2025

Hello !

I have a question about the Documentation for the API, there is something I don't understand.
The name of the app we need to install is: OCS API Viewer
so, I think it's just something to only "read the API"

so, if we want to write a new information into a column of a specific table,
How to do it ?

Regards.

@boddedo boddedo changed the title [information] Need more information about the API [Question] Need more information about the API Jan 2, 2025
@vimoi
Copy link

vimoi commented Jan 2, 2025

Writing Data to Tables API

While the OCS API Viewer is for reading the API documentation, you can use any HTTP client (like cURL, Postman, or your own code) to write data to tables.

Writing to Columns

To change the value of a column, use the example below.

❗ Note that you need to use "" around column IDs in request bodies, even though the column IDs don't have them in response bodies.

PUT {{baseUrl}}/index.php/apps/tables/api/1/rows/{{rowId}}`
  {
      "data": {
        "{{columnId}}": "String Value",
        "{{columnId}}": 42
      }
  }

Getting Column IDs

Before writing, you'll need the column IDs. Get them using either of these requests:

GET {{baseUrl}}/index.php/apps/tables/api/1/tables/{{tableId}}/scheme
GET {{baseUrl}}/index.php/apps/tables/api/1/tables/{{tableId}}/rows

The documentation with all available endpoints can be found here:
https://petstore.swagger.io/?url=https://raw.githubusercontent.com/nextcloud/tables/main/openapi.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants