Delete Fields
This text provides an example of how to call Delete fields interface.
Example: delete fields
Assuming you have a datasheet, you would like to delete one of these fields.
Your action steps below:
Get your API Token.(How to get it)
Get your Space ID.(How to get it)
Get the ID of the datasheet.(How to get it)
Get the ID of the field that needs to be deleted.(How to get it)
Open the terminal on your computer and execute the following code to send a query request to the server (Assuming spaceId is
spcjXzqVrjaP3
,datasheetId isdstNiC6R9MryevVaCQ
, fieldId isfld4SRHNAugJq
) :- cURL
- Javascript SDK
- Python SDK
curl -X DELETE \
"https://aitable.ai/fusion/v1/spaces/spcjXzqVrjaP3/datasheets/dstNiC6R9MryevVaCQ/fields/fld4SRHNAugJq" \
-H "Authorization: Bearer {Your API Token}"Note: Need to Download and initialize Javascript SDK first, and then execute the following command.
import { APITable } from 'apitable';
const apitable = new APITable({
token: 'Your API Token',
});
try {
const resp = await apitable.space('spcjXzqVrjaP3').datasheet('dstNiC6R9MryevVaCQ').fields.delete('fld4SRHNAugJq');
if (resp.success) {
// TODO:
}
} catch (error) {
// TODO: handle error
}Note: You need to download and initialize the Python SDK first, and then execute the following command.
from apitable import Apitable
apitable = Apitable("Your API Token")
try:
apitable.space('spcjXzqVrjaP3').datasheet('dstNiC6R9MryevVaCQ').fields.delete('fld4SRHNAugJq')
except Exception:
# Handling abnormal situations
passUpon success, the server will return the following JSON data.
For the meaning of each parameter in the response, please check the API Reference
{
"success": true,
"code": 200,
"message": "SUCCESS",
"data": {}
}