# RSS Feeds

API for managing rss feeds

## List RSS Feeds

<mark style="color:blue;">`GET`</mark> `https://www.magloft.com/api/portal/v1/rss_feeds/:app_id`

This endpoint **returns** a list of all `RSS Feeds` that belong to the publication

#### Path Parameters

| Name    | Type   | Description                                     |
| ------- | ------ | ----------------------------------------------- |
| app\_id | String | App ID (Publication) to scope this request for. |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "id": 1234,
  "url": "https://blog.magloft.com/feed/",
  "title": "MagLoft Blog",
  "description": "MagLoft Blog Description",
  "cover": "https://mms.magloft.com/USERID/ASSETID",
  "active": true,
  "job_id": "123412341234",
  "job_status": "pending",
  "import_source": true,
  "import_author": true,
  "auto_publish": true,
  "show_related_articles": true,
  "imported_at": "2018-01-24 10:55:35",
  "created_at": "2018-01-24 10:55:35",
  "updated_at": "2018-01-24 10:55:35",
  "category_ids": [
    1,
    2,
    3
  ]
}
```

{% endtab %}
{% endtabs %}

## Create RSS Feed

<mark style="color:green;">`POST`</mark> `https://www.magloft.com/api/portal/v1/rss_feeds/:app_id`

This endpoint **creates** a new `RSS Feed` and **returns** the saved `RSS Feed`

#### Path Parameters

| Name    | Type   | Description                                     |
| ------- | ------ | ----------------------------------------------- |
| app\_id | String | App ID (Publication) to scope this request for. |

#### Request Body

| Name                    | Type                       | Description                                                                              |
| ----------------------- | -------------------------- | ---------------------------------------------------------------------------------------- |
| url                     | String                     | External Blog URL to import articles from                                                |
| title                   | String                     | Title of the RSS Feed                                                                    |
| import\_source          | Virtus::Attribute::Boolean | Boolean indicating whether the RSS Feed will import source of article                    |
| import\_author          | Virtus::Attribute::Boolean | Boolean indicating whether the RSS Feed will import author of article                    |
| show\_related\_articles | Virtus::Attribute::Boolean | Boolean indicating whether the imported article will show related articles               |
| auto\_publish           | Virtus::Attribute::Boolean | Boolean indicating whether the article from the RSS Feed will be automatically published |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "id": 1234,
  "url": "https://blog.magloft.com/feed/",
  "title": "MagLoft Blog",
  "description": "MagLoft Blog Description",
  "cover": "https://mms.magloft.com/USERID/ASSETID",
  "active": true,
  "job_id": "123412341234",
  "job_status": "pending",
  "import_source": true,
  "import_author": true,
  "auto_publish": true,
  "show_related_articles": true,
  "imported_at": "2018-01-24 10:55:35",
  "created_at": "2018-01-24 10:55:35",
  "updated_at": "2018-01-24 10:55:35",
  "category_ids": [
    1,
    2,
    3
  ]
}
```

{% endtab %}
{% endtabs %}

## Get RSS Feed

<mark style="color:blue;">`GET`</mark> `https://www.magloft.com/api/portal/v1/rss_feeds/:app_id/:id`

This endpoint **returns** a specific `rss feed` by `id`

#### Path Parameters

| Name    | Type    | Description                                     |
| ------- | ------- | ----------------------------------------------- |
| app\_id | String  | App ID (Publication) to scope this request for. |
| id      | Integer | RSS Feed ID                                     |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "id": 1234,
  "url": "https://blog.magloft.com/feed/",
  "title": "MagLoft Blog",
  "description": "MagLoft Blog Description",
  "cover": "https://mms.magloft.com/USERID/ASSETID",
  "active": true,
  "job_id": "123412341234",
  "job_status": "pending",
  "import_source": true,
  "import_author": true,
  "auto_publish": true,
  "show_related_articles": true,
  "imported_at": "2018-01-24 10:55:35",
  "created_at": "2018-01-24 10:55:35",
  "updated_at": "2018-01-24 10:55:35",
  "category_ids": [
    1,
    2,
    3
  ]
}
```

{% endtab %}
{% endtabs %}

## Update RSS Feed

<mark style="color:orange;">`PUT`</mark> `https://www.magloft.com/api/portal/v1/rss_feeds/:app_id/:id`

This endpoint **updates** a specific `rss feed` by `id` and **returns** the updated `rss feed`

#### Path Parameters

| Name    | Type    | Description                                     |
| ------- | ------- | ----------------------------------------------- |
| app\_id | String  | App ID (Publication) to scope this request for. |
| id      | Integer | RSS Feed ID                                     |

#### Request Body

| Name                    | Type                       | Description                                                                              |
| ----------------------- | -------------------------- | ---------------------------------------------------------------------------------------- |
| title                   | String                     | Title of the RSS Feed                                                                    |
| description             | String                     | Description of the RSS Feed                                                              |
| cover                   | String                     | Cover URL of the RSS Feed                                                                |
| active                  | Virtus::Attribute::Boolean | Boolean indicating whether the RSS Feed is currently active                              |
| import\_source          | Virtus::Attribute::Boolean | Boolean indicating whether the RSS Feed will import source of article                    |
| import\_author          | Virtus::Attribute::Boolean | Boolean indicating whether the RSS Feed will import author of article                    |
| auto\_publish           | Virtus::Attribute::Boolean | Boolean indicating whether the article from the RSS Feed will be automatically published |
| show\_related\_articles | Virtus::Attribute::Boolean | Boolean indicating whether the imported article will show related articles               |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "id": 1234,
  "url": "https://blog.magloft.com/feed/",
  "title": "MagLoft Blog",
  "description": "MagLoft Blog Description",
  "cover": "https://mms.magloft.com/USERID/ASSETID",
  "active": true,
  "job_id": "123412341234",
  "job_status": "pending",
  "import_source": true,
  "import_author": true,
  "auto_publish": true,
  "show_related_articles": true,
  "imported_at": "2018-01-24 10:55:35",
  "created_at": "2018-01-24 10:55:35",
  "updated_at": "2018-01-24 10:55:35",
  "category_ids": [
    1,
    2,
    3
  ]
}
```

{% endtab %}
{% endtabs %}

## Delete RSS Feed

<mark style="color:red;">`DELETE`</mark> `https://www.magloft.com/api/portal/v1/rss_feeds/:app_id/:id`

This endpoint **deletes** a specific `RSS Feed` by `id` and **returns** an `empty response` with status `204`

#### Path Parameters

| Name    | Type    | Description                                     |
| ------- | ------- | ----------------------------------------------- |
| app\_id | String  | App ID (Publication) to scope this request for. |
| id      | Integer | RSS Feed ID                                     |

{% tabs %}
{% tab title="200 " %}

```javascript
null
```

{% endtab %}
{% endtabs %}

## Synchronize RSS Feed

<mark style="color:green;">`POST`</mark> `https://www.magloft.com/api/portal/v1/rss_feeds/:app_id/:id/synchronize`

This endpoint **synchronizes** entries from an existing `RSS Feed` by `id` and **returns** the `synchronization results`

#### Path Parameters

| Name    | Type    | Description                                     |
| ------- | ------- | ----------------------------------------------- |
| app\_id | String  | App ID (Publication) to scope this request for. |
| id      | Integer | RSS Feed ID                                     |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "id": 1234,
  "url": "https://blog.magloft.com/feed/",
  "title": "MagLoft Blog",
  "description": "MagLoft Blog Description",
  "cover": "https://mms.magloft.com/USERID/ASSETID",
  "active": true,
  "job_id": "123412341234",
  "job_status": "pending",
  "import_source": true,
  "import_author": true,
  "auto_publish": true,
  "show_related_articles": true,
  "imported_at": "2018-01-24 10:55:35",
  "created_at": "2018-01-24 10:55:35",
  "updated_at": "2018-01-24 10:55:35",
  "category_ids": [
    1,
    2,
    3
  ]
}
```

{% endtab %}
{% endtabs %}
