# Terms API

* [Properties](#terms-properties)
* [GET /api/terms](#GET-/api/terms)
* [POST /api/terms](#POST-/api/terms)
* [GET /api/terms/:termId](#GET-/api/terms/termId)
* [PUT /api/terms/:termId](#PUT-/api/terms/termId)
* [DELETE /api/terms/:termId](#DELETE-/api/terms/termId)

## Terms

Terms in Nosto's UGC allow us to set the rules to ingest content from different networks (such as user-generated content from Social Networks) - it is defined as an ingestion query within Nosto's platform.

### Properties

| Field                          | Type      | Value                                                                                                                                                                                                                                                                                         | POST  | PUT   | Definition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                             | integer   |                                                                                                                                                                                                                                                                                               | **X** | **X** | unique id for term                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| name                           | string    |                                                                                                                                                                                                                                                                                               | ✔     | ✔     | Name this new term                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| display\_name                  | string    |                                                                                                                                                                                                                                                                                               | ✔     | ✔     | Display name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| active                         | bool      | <p><code>1</code> (true)<br><code>0</code> (false)</p>                                                                                                                                                                                                                                        | ✔     | ✔     | Flag: 1 or 0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| type                           | string    |                                                                                                                                                                                                                                                                                               | ✔     | **X** | <p>post: <strong>Required</strong><br>Type of term for network. The value must be:<br><code>default</code> - ecal<br><code>page</code> - facebook, pinterest, rss<br><code>hashtag</code> - twitter, instagram<br><code>user</code> - twitter, instagram, gplus, youtube, flickr, pinterest<br><code>search</code> - twitter, gplus, youtube<br><code>location</code> - twitter, instagram<br><code>gallery</code> - flickr<br><code>set</code> - flickr<br><code>blog</code> - tumblr<br><code>atom</code> - rss<br><code>post</code> - sta\_feed<br><code>weiboshow</code><br><code>weibopage</code><br><code>weibotopic</code><br><code>page</code></p> |
| network                        | string    | <p><code>twitter</code><br><code>facebook</code><br><code>instagram</code><br><code>youtube</code><br><code>gplus</code><br><code>flickr</code><br><code>pinterest</code><br><code>tumblr</code><br><code>rss</code><br><code>ecal</code><br><code>sta\_feed</code><br><code>weibo</code></p> | ✔     | **X** | <p>post: <strong>Required</strong></p><p>The source of social network</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| term                           | string    |                                                                                                                                                                                                                                                                                               | ✔     | ✔     | <p>post: <strong>Required</strong></p><p>The term query</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| filter                         | string    |                                                                                                                                                                                                                                                                                               | ✔     | ✔     | Ingestion filter / keywords in CSV format                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| exclude\_filter                | string    |                                                                                                                                                                                                                                                                                               | ✔     | ✔     | Exclude-filter / keywords in CSV format                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| fan\_filter                    | string    |                                                                                                                                                                                                                                                                                               | ✔     | ✔     | Fan-filter in CSV format                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| fan\_exclude\_filter           | string    |                                                                                                                                                                                                                                                                                               | ✔     | ✔     | Fan-exclude-filter in CSV format                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| minimum\_followers             | integer   |                                                                                                                                                                                                                                                                                               | ✔     | ✔     | Threshold for minimum followers, available only for twitter - search and hashtag terms                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| moderate\_text                 | enum      | <p><code>publish</code><br><code>queue</code><br><code>disable</code><br><code>exclude</code></p>                                                                                                                                                                                             | ✔     | ✔     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| moderate\_image                | enum      | <p><code>publish</code><br><code>queue</code><br><code>disable</code><br><code>exclude</code></p>                                                                                                                                                                                             | ✔     | ✔     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| moderate\_video                | enum      | <p><code>publish</code><br><code>queue</code><br><code>disable</code><br><code>exclude</code></p>                                                                                                                                                                                             | ✔     | ✔     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| retweet\_enable                | bool      |                                                                                                                                                                                                                                                                                               | ✔     | ✔     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| reply\_enable                  | bool      |                                                                                                                                                                                                                                                                                               | ✔     | ✔     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| reply\_to\_enable              | bool      |                                                                                                                                                                                                                                                                                               | ✔     | ✔     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| partial\_match                 | bool      |                                                                                                                                                                                                                                                                                               | ✔     | ✔     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| include\_fan\_content          | bool      |                                                                                                                                                                                                                                                                                               | ✔     | ✔     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| include\_hashtag\_in\_comments | bool      |                                                                                                                                                                                                                                                                                               | ✔     | ✔     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| include\_official\_content     | bool      |                                                                                                                                                                                                                                                                                               | ✔     | ✔     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| search\_exact\_phrase          | string    |                                                                                                                                                                                                                                                                                               | ✔     | ✔     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| verified\_accounts             | string    |                                                                                                                                                                                                                                                                                               | ✔     | ✔     | Include tweets of verified twitter accounts only                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| num\_of\_backfill              | integer   |                                                                                                                                                                                                                                                                                               | ✔     | **X** |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| whitelist\_handles             | string    |                                                                                                                                                                                                                                                                                               | ✔     | ✔     | White listing handle/username in CSV format                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| blacklist\_handles             | string    |                                                                                                                                                                                                                                                                                               | ✔     | ✔     | Black listing handle/username in CSV format                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| source\_user\_id               | string    |                                                                                                                                                                                                                                                                                               | ✔     | ✔     | <p>post: <strong>Required</strong> if <code>type</code> is one of this value \[user, page, gallery, set]</p><p>Original user id / identifier for the network</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| tags                           | array     |                                                                                                                                                                                                                                                                                               | ✔     | ✔     | Default tagging for ingested content                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| created                        | timestamp |                                                                                                                                                                                                                                                                                               | **X** | **X** | Term's creation time                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| modified                       | timestamp |                                                                                                                                                                                                                                                                                               | **X** | **X** | Term's modification time                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| last\_ingestion\_post          | timestamp |                                                                                                                                                                                                                                                                                               | **X** | **X** | Term's last ingestion post time                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

[Back to Top](#top)

### GET terms

Retrieves all terms available in the Stack.

#### Resource URL

`https://api.stackla.com/api/terms`

#### Resource Details

Rate limited: Yes

Access scope: User

#### Request Parameters

| Name  | Mandatory | Request type | Description                                                                                              |
| ----- | --------- | ------------ | -------------------------------------------------------------------------------------------------------- |
| page  | No        | query        | Page number. Default value is 1                                                                          |
| limit | No        | query        | Return limit define how many Terms will be return for each request. Default is 25. Maximum limit is 100. |

[Back to Top](#top)

### POST terms

Creates a new Term in the Stack.

#### Resource URL

`https://api.stackla.com/api/terms`

#### Resource Details

Rate limited: Yes

Access scope: User

#### Request Parameters

No additional request parameters are available.

[Back to Top](#top)

### GET terms/:termId

Retrieves a specific Term available in the Stack by its ID.

#### Resource URL

`https://api.stackla.com/api/terms/:termId`

#### Resource Details

Rate limited: Yes

Access scope: User

#### Request Parameters

| Name   | Mandatory | Request type | Description    |
| ------ | --------- | ------------ | -------------- |
| termId | Yes       | Request type | ID of the Term |

[Back to Top](#top)

### PUT terms/:termId

Updates a specific Term available in the Stack by its ID.

#### Resource URL

`https://api.stackla.com/api/terms/:termId`

#### Resource Details

Rate limited: Yes

Access scope: User

#### Request Parameters

| Name   | Mandatory | Request type | Description    |
| ------ | --------- | ------------ | -------------- |
| termId | Yes       | endpoint     | ID of the Term |

[Back to Top](#top)

### DELETE terms/:termId

Deletes a specific Term available in the Stack by its ID.

#### Resource URL

`https://api.stackla.com/api/terms/:termId`

#### Resource Details

Rate limited: Yes

Access scope: User

#### Request Parameters

| Name   | Mandatory | Request type | Description    |
| ------ | --------- | ------------ | -------------- |
| termId | Yes       | endpoint     | ID of the Term |

[Back to Top](#top)
