# SCIM DomainValue examples

## Operations

This page shows the operations that can be performed for the DomainValue object. The DomainValue is related to Information Systems.

> Role scope or domains are properties that can be assigned to some entitlements, limiting the scope of that entitlement. This can be used to limit, for instance, the maximum amount allowed for a money transfer, or the commercial zones to manage.

### List all

##### Request

```MarkDown
GET https://<your-domain>/soffid/webservice/scim2/v1/DomainValue
```

##### Response 200 OK

```JSON
{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:ListResponse"
    ],
    "totalResults": 4,
    "startIndex": 1,
    "Resources": [
        {
            "meta": {
                "location": "http://soffid.pat.lab:8080/soffid/webservice/scim2/v1/DomainValue/499623",
                "resourceType": "DomainValue"
            },
            "domainName": "Zone",
            "externalCodeDomain": "Operation",
            "schemas": [
                "urn:soffid:com.soffid.iam.iga.api.DomainValue"
            ],
            "description": "Twenty",
            "id": 499623,
            "value": "20"
        },
        {
            "meta": {
                "location": "http://soffid.pat.lab:8080/soffid/webservice/scim2/v1/DomainValue/499629",
                "resourceType": "DomainValue"
            },
            "domainName": "Zone",
            "externalCodeDomain": "Operation",
            "schemas": [
                "urn:soffid:com.soffid.iam.iga.api.DomainValue"
            ],
            "description": "Eleven",
            "id": 499629,
            "value": "10"
        },
      .............
    ]
}
```

### List by filter

List all DomainValues with a filter expression.

<p class="callout info">It is allowed to use pagination and sort the information, for more information visit the [Sorting](https://bookstack.soffid.com/link/116#bkmrk-sorting) and [Pagination](https://bookstack.soffid.com/link/116#bkmrk-pagination) information.</p>

##### Request

```MarkDown
GET https://<your-domain>/soffid/webservice/scim2/v1/DomainValue?filter=description co Tw
```

##### Response 200 OK

```JSON
{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:ListResponse"
    ],
    "totalResults": 1,
    "startIndex": 1,
    "Resources": [
        {
            "meta": {
                "location": "http://soffid.pat.lab:8080/soffid/webservice/scim2/v1/DomainValue/499623",
                "resourceType": "DomainValue"
            },
            "domainName": "Zone",
            "externalCodeDomain": "Operation",
            "schemas": [
                "urn:soffid:com.soffid.iam.iga.api.DomainValue"
            ],
            "description": "Twenty",
            "id": 499623,
            "value": "20"
        }
    ]
}
```

### Query by id

Query a DomainValue by its id (primary key).

##### Request

```MarkDown
GET https://<your-domain>/soffid/webservice/scim2/v1/DomainValue/802012
```

##### Response 200 OK

```JSON
{
    "meta": {
        "location": "http://soffid.pat.lab:8080/soffid/webservice/scim2/v1/DomainValue/802012",
        "resourceType": "DomainValue"
    },
    "domainName": "Company",
    "externalCodeDomain": "Operation/Business 2/SOFFID",
    "schemas": [
        "urn:soffid:com.soffid.iam.api.DomainValue"
    ],
    "description": "Soffid",
    "id": 802012,
    "value": "Soffid"
}
```

### Create

#### Request

```XML
POST https://<your-domain>/soffid/webservice/scim2/v1/DomainValue
```

**JSON**

```JSON
{
    "schemas": [
        "urn:soffid:com.soffid.iam.iga.api.DomainValue"
    ],
    "domainName": "Company",
    "externalCodeDomain": "Operation/Business 2/SOFFID",
    "description": "bubble",
    "value": "bubble"
}
```

##### Response 201 Created

```JSON
{
    "meta": {
        "location": "http://soffid.pat.lab:8080/soffid/webservice/scim2/v1/DomainValue/1977131",
        "resourceType": "DomainValue"
    },
    "domainName": "Company",
    "externalCodeDomain": "Operation/Business 2/SOFFID",
    "schemas": [
        "urn:soffid:com.soffid.iam.api.DomainValue"
    ],
    "description": "bubble",
    "id": 1977131,
    "value": "bubble"
}
```

### Update partial

Only attributes with changes will be updated, the other will maintain the same value.

##### Request

```XML
PATCH https://<your-domain>/soffid/webservice/scim2/v1/DomainValue/1976741
```

**JSON**

```JSON
{
    "Operations": [
        {
            "op": "replace",
            "path": "description",
            "value": "Bubble description"
        }
    ]
}
```

##### Response 200 OK

```JSON
{
    "meta": {
        "location": "http://soffid.pat.lab:8080/soffid/webservice/scim2/v1/DomainValue/1977131",
        "resourceType": "DomainValue"
    },
    "domainName": "Company",
    "externalCodeDomain": "Operation/Business 2/SOFFID",
    "schemas": [
        "urn:soffid:com.soffid.iam.iga.api.DomainValue"
    ],
    "description": "Bubble description",
    "id": 1977131,
    "value": "bubble"
}
```

### Update all

This operation replaces all values in the DomainValue.

- Note that the attribute id is required to confirm that the resource "...DomainValue/&lt;id&gt;" is the same that the JSON DomainValue.
- Note that all the attributes not included in the request will be cleared in the DomainValue type and their data will be lost.
- Note that not all the attributes are updatable, for example, tag meta, avoid these tags. For more information visit the [Resource data model page](https://bookstack.soffid.com/books/scim/chapter/resource-data-model-schema)

##### Request

```XML
PUT https://<your-domain>/soffid/webservice/scim2/v1/DomainValue/1977131
```

**JSON**

```JSON
{
    "schemas": [
        "urn:soffid:com.soffid.iam.iga.api.GroupUser"
    ],
    "id": 1976741,
    "group": "it",
    "groupDescription": "Help desk support team",
    "user": "ckelp",
    "fullName": "Casey Kelp",
    "primaryGroup": true,
    "attributes": {}
}
```

##### Response 200 OK

```JSON
{
    "schemas": [
        "urn:soffid:com.soffid.iam.iga.api.DomainValue"
    ],
    "id": 1977131,
    "domainName": "Company",
    "externalCodeDomain": "Operation/Business 2/SOFFID",
    "description": "New bubble",
    "value": "Newbubble"
}
```

### Delete

<p class="callout warning">Please note after this delete, the DomainValue has to be created again to use it in the next examples.</p>

##### Request

```MarkDown
DELETE https://<your-omain>/soffid/webservice/scim2/v1/DomainValue/1977131
```

##### Response 204 No Content

```
204 No Content
```

### Error response

<p class="callout info">For more information about error response visit [https://bookstack.soffid.com/link/116#bkmrk-error-response](https://bookstack.soffid.com/link/116#bkmrk-error-response)</p>