# Parsing Role Options

{% tabs %}
{% tab title="Requesting JSON" %}

```
/category-advanced parse-options-http
```

`base-link`: Link to the raw JSON or API that returns a valid JSON. If there are several pages, provide a link without a page number at the end.

`array-name`: The name of the array if it's an object, or `[]` if it's just an array.

`option-name-key`: An element key of role name.

`option-id-key`: An element key of role ID (don't specify if you're using `role-determination` option).

`option-additional-key`: An element key of the additional info to display as option's description.

#### Example Object

Command options in this example:

`array-name`: roles

`option-name-key`: name

`option-id-key`: id

{% code title="roles.json" %}

```json
{
    "roles": [
        { "name": "Test Role 1", "id": "1092819232623964220" },
        { "name": "Test Role 2", "id": "1093119385926897696" },
        { "name": "Test Role 3", "id": "1092826062720872558" }
    ],
    "page": 1
}
```

{% endcode %}

#### Example Array

Command options in this example:

`array-name`: \[]

`option-name-key`: roleName

`option-additional-key`: info

{% code title="roles.json" %}

```json
[
    { "roleName": "Test Role 1", "info": "Role Description 1" },
    { "roleName": "Test Role 2", "info": "Role Description 2" },
    { "roleName": "Test Role 3", "info": "Role Description 3" }
]
```

{% endcode %}
{% endtab %}

{% tab title="Parsing Website" %}

```
/category-advanced parse-options-html
```

`base-link`: Link for parsing elements. If there are several pages, provide a link without a page number at the end.

`element-query-selector`: [CSS selector](https://developer.mozilla.org/docs/Web/CSS/CSS_Selectors) of the element (role option). Use `.` at the start for class, and `#` for ID. Example: `.element`

`element-title-query-selector`: [CSS selector](https://developer.mozilla.org/docs/Web/CSS/CSS_Selectors) of the element's title (role option's label). Example: `.title`

`role-determination`: The way to define roles from elements, i.e. compare element title and role name.

`element-additional-queryselector`: Additional info to display as option's description.

### How to get element's class or ID

1. Open Developer Tools:

**For Chrome:**

Right-click an element and select "Inspect Element".

**For Microsoft Edge or Firefox:**

Press `F12` or `Ctrl+Shift+I` on the keyboard and find the elements.

2. Hover over one of the elements in the panel, it should be highlighted:

![](https://985934113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEa6g5Gb6Ew3IUZoo1T1C%2Fuploads%2FgpCPQVJ4ynPjosMLrZZy%2Fimage.png?alt=media\&token=f68b2713-9464-489f-b4d9-68680986dbcd)

3. Copy what's after `class=` or `id=`
   {% endtab %}
   {% endtabs %}

{% hint style="info" %}
After a successful update of the category, provided parsing settings will be assigned to this category. `Synchronize` context-menu command will update the options using the saved settings.
{% endhint %}

## Synchronization on Request (API)

Once you've assigned parsing settings within a category, you can use synchronization via the API or using the context menu.

{% content-ref url="../api/parsing-role-options" %}
[parsing-role-options](https://kayfarik.gitbook.io/docs/api/parsing-role-options)
{% endcontent-ref %}
