API to insert record [Jul 01]

:raising_hand_man: Trung BUI asked

Hi !, i wondering if it’s possible to fill out the form by API and then submit ? I’m working with django, so i need to do that from django

:man_bald: dstala replied

<@899573201598836747> You can use API to insert record

NocoDB API Documentation

:raising_hand_man: Trung BUI replied

Do you know how can i get REST API Schema ?

:person_tipping_hand: o1lab replied

you would have to simply go to respective project’s swagger schema

:person_tipping_hand: o1lab replied

bottom left

:raising_hand_man: Trung BUI replied

I mean are there any REST APIs to get the schema or not ?

:raising_hand_man: Trung BUI replied

I know i can find in swagger schema but i want get schema from api in python actually.

:man_bald: dstala replied

Get list of projects & to derive project-id

GET /api/v1/db/meta/projects

Get list of tables in a project & to derive table-id

GET /api/v1/db/meta/projects/{projectId}/tables

Get table schema using table-id

GET /api/v1/db/meta/tables/{tableId}

:man_bald: dstala replied

Code snippet example for python can be found by clicking code snippet option once you open any table in UI at right bottom corner

```

import http.client

conn = http.client.HTTPConnection(“localhost:8080”)

headers = { ‘xc-auth’: “eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InVzZXJAbm9jb2RiLmNvbSIsImZpcnN0bmFtZSI6bnVsbCwibGFzdG5hbWUiOm51bGwsImlkIjoidXNfMGZnY3cyNnY4bDMzY2YiLCJyb2xlcyI6InVzZXIsc3VwZXIiLCJ0b2tlbl92ZXJzaW9uIjoiOTQ0MWExMGY3MTk1ZWI0ZThiNTViYzdkOWVmOTBmY2RlMjViZjM2NGQ2MTkwZWIzZGMxOWI5M2I5NDVmNjAwNTA1MzM3MWExYTI3ZGQ5NTAiLCJpYXQiOjE2NTY0OTY5MTMsImV4cCI6MTY1NjUzMjkxM30.uuzJdgVXYjBSzzADFSxTGjqfO3YZawnm-E1CIAlbZMg” }

conn.request(“GET”, “/api/v1/db/data/noco/p_wiukyreqe052rf/Actor/views/Grid%20view?limit=25&offset=0&where=”, headers=headers)

res = conn.getresponse()

data = res.read()

print(data.decode(“utf-8”))

```

:man_bald: dstala replied

You need to configure auth token appropriately (right top 3-dot menu, Copy Auth Token)

:raising_hand_man: Trung BUI replied

Thanks a lot ! Can u help me how to use signup with API ? I can not to use it.

image0

:raising_hand_man: Trung BUI replied

With404 error!

:raising_hand_man: Trung BUI replied

How can i create users automatically from script in python ? Is that possible ?

:man_bald: dstala replied

did we ensure we passed appropriate credentials for xc-auth?

:man_bald: dstala replied

refer API details here (projectUserList/Add/Update/Remove)

REST APIs - NocoDB

:raising_hand_man: Trung BUI replied

I’m trying login by api from my app, but when i was connecting dashboard, it always ask me to login.

:raising_hand_man: Trung BUI replied

Someone can help me :sob:

:raising_hand_man: Trung BUI replied

My app is running on Django at port 8081 and nocodb at port 8080, i’m trying to login the user when they click on a button form my app

:person_tipping_hand: o1lab replied

sorry, its not clear if you are login via API and access dashboard - you would still have to login via our UI to access dashboard :sweat_smile:

:raising_hand_man: Trung BUI replied

Yes, it’s problem, so how i can access directly to dashboard by trying call API login