Get database fields
Description
Retrieves database fields information. The types of fields and allowed values are described in this article.
Request URL
Method: POST
https://example.com/api/v1.1/databases/fields_get/
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
id | int | 1 | Yes | Database ID |
format | int | "json" | No | Response data format By default – json |
Request example
- JSON
- XML
{
"id": 1,
"token": "abcdefghijklmnqrstuvwxyz"
}
<?xml version="1.0" encoding="UTF-8" ?>
<xml>
<id>1</id>
<token>abcdefghijklmnqrstuvwxyz</token>
</xml>
Response example
- JSON
- XML
{
"data": [
{
"category": "system",
"title": "Id",
"name": "_id",
"required": true,
"submanager": false,
"type": "unicode",
"enum_values": null
},
{
"category": "default",
"title": "FirstName",
"name": "_fname",
"required": false,
"submanager": false,
"type": "unicode",
"enum_values": null
},
{
"category": "custom",
"title": "Custom_String",
"name": "Custom_String",
"required": false,
"submanager": false,
"type": "unicode",
"enum_values": null
},
{
"category": "custom",
"title": "Custom_Int",
"name": "Custom_Int",
"required": false,
"submanager": false,
"type": "int",
"enum_values": null
},
{
"category": "custom",
"title": "Custom_Bool",
"name": "Custom_Bool",
"required": false,
"submanager": false,
"type": "bool",
"enum_values": null
},
{
"category": "custom",
"title": "Custom_Date",
"name": "Custom_Date",
"required": false,
"submanager": false,
"type": "date",
"enum_values": null
},
{
"category": "custom",
"title": "Custom_Tags",
"name": "Custom_Tags",
"required": false,
"submanager": false,
"type": "tags",
"enum_values": null
},
{
"category": "custom",
"title": "Custom_Enum",
"name": "Custom_Enum",
"required": false,
"submanager": false,
"type": "enum",
"enum_values": [
{
"name": "GMail",
"value": 2
},
{
"name": "HotMail",
"value": 3
},
{
"name": "Yahoo!",
"value": 1
}
]
}
],
"error": 0,
"error_text": "Successful operation"
}
<?xml version="1.0" encoding="UTF-8" ?>
<xml>
<data>
<category>system</category>
<title>Id</title>
<name>_id</name>
<required>true</required>
<submanager>false</submanager>
<type>unicode</type>
<enum_values />
</data>
<data>
<category>default</category>
<title>FirstName</title>
<name>_fname</name>
<required>false</required>
<submanager>false</submanager>
<type>unicode</type>
<enum_values />
</data>
<data>
<category>custom</category>
<title>Custom_String</title>
<name>Custom_String</name>
<required>false</required>
<submanager>false</submanager>
<type>unicode</type>
<enum_values />
</data>
<data>
<category>custom</category>
<title>Custom_Int</title>
<name>Custom_Int</name>
<required>false</required>
<submanager>false</submanager>
<type>int</type>
<enum_values />
</data>
<data>
<category>custom</category>
<title>Custom_Bool</title>
<name>Custom_Bool</name>
<required>false</required>
<submanager>false</submanager>
<type>bool</type>
<enum_values />
</data>
<data>
<category>custom</category>
<title>Custom_Date</title>
<name>Custom_Date</name>
<required>false</required>
<submanager>false</submanager>
<type>date</type>
<enum_values />
</data>
<data>
<category>custom</category>
<title>Custom_Tags</title>
<name>Custom_Tags</name>
<required>false</required>
<submanager>false</submanager>
<type>tags</type>
<enum_values />
</data>
<data>
<category>custom</category>
<title>Custom_Enum</title>
<name>Custom_Enum</name>
<required>false</required>
<submanager>false</submanager>
<type>enum</type>
<enum_values>
<name>GMail</name>
<value>2</value>
</enum_values>
<enum_values>
<name>HotMail</name>
<value>3</value>
</enum_values>
<enum_values>
<name>Yahoo!</name>
<value>1</value>
</enum_values>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |
category | string | Field category |
title | string | Field title |
name | string | Field name |
required | bool | Required flag |
submanager | bool | Subscription manager access |
type | string | Field type |
enum_values | Enum list values |