> This page is for API Reference.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fiftytwo-demo.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fiftytwo-demo.ferndocs.com/_mcp/server.

# Get view group by ID and Chain

GET https://api.fiftytwo.com/masterdata/viewgroups/v1/chain/{chainId}/{viewGroupId}



Reference: https://fiftytwo-demo.ferndocs.com/api/master-data/reference/view-groups/get-view-group-by-id-and-chain

## Request

### Path parameters

- `viewGroupId` (string, required) — The ID of the view group to retrieve
- `chainId` (integer, required) — The ID of the Chain

## Response

### 200

Success

- `viewGroups` (list of ViewGroupsViewGroupsItems, required)

## Errors

### 400 Bad Request Error

Bad Request

- `string`

## Types

### ViewGroupsViewGroupsItems

- `viewGroupId` (integer, required) — Unique numeric identifier for the view group. (VA09).
- `name` (string, required) — The display name of the view group shown in the user interface.
- `description` (string, optional) — Short optional description of the view group.
- `imageId` (string, optional) — Identifier of the image linked to this view group. Must be a 32-character lowercase MD5 hash. For more information, see the image section.
- `details` (ViewGroupsViewGroupsItemsDetails, optional) — Defines which items belong to this view group, grouped by item type. Can include articles or nested view groups.

### ViewGroupsViewGroupsItemsDetails

Defines which items belong to this view group, grouped by item type. Can include articles or nested view groups.

- `articles` (list of integer, optional) — List of article IDs that are part of the view group.
- `viewGroups` (list of integer, optional) — List of nested view group IDs that are part of the view group.

## Examples

**Response**

```json
{
  "viewGroups": [
    {
      "viewGroupId": 1001,
      "name": "Fresh Food",
      "description": "Store front",
      "imageId": "aabbccddeeff00112233445566778899",
      "details": {
        "articles": [
          20001,
          20002
        ],
        "viewGroups": [
          1101,
          1102
        ]
      }
    },
    {
      "viewGroupId": 1101,
      "name": "Fruits",
      "description": "Seasonal mix",
      "imageId": "112233445566778899aabbccddeeff00",
      "details": {
        "articles": [
          30001,
          30002,
          30003
        ],
        "viewGroups": []
      }
    },
    {
      "viewGroupId": 1102,
      "name": "Vegetables",
      "description": "Daily greens",
      "imageId": "ffeeddccbbaa99887766554433221100",
      "details": {
        "articles": [
          31001,
          31002
        ],
        "viewGroups": []
      }
    },
    {
      "viewGroupId": 1200,
      "name": "Weekly Deals",
      "description": "Promo picks",
      "imageId": "00112233445566778899aabbccddeeff",
      "details": {
        "articles": [
          40001
        ],
        "viewGroups": [
          1001
        ]
      }
    }
  ]
}
```

**SDK Code**

```python ViewGroups_getViewGroupByIdAndChain_example
import requests

url = "https://api.fiftytwo.com/masterdata/viewgroups/v1/chain/1/viewGroupId"

response = requests.get(url)

print(response.json())
```

```javascript ViewGroups_getViewGroupByIdAndChain_example
const url = 'https://api.fiftytwo.com/masterdata/viewgroups/v1/chain/1/viewGroupId';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go ViewGroups_getViewGroupByIdAndChain_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fiftytwo.com/masterdata/viewgroups/v1/chain/1/viewGroupId"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby ViewGroups_getViewGroupByIdAndChain_example
require 'uri'
require 'net/http'

url = URI("https://api.fiftytwo.com/masterdata/viewgroups/v1/chain/1/viewGroupId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java ViewGroups_getViewGroupByIdAndChain_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.fiftytwo.com/masterdata/viewgroups/v1/chain/1/viewGroupId")
  .asString();
```

```php ViewGroups_getViewGroupByIdAndChain_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.fiftytwo.com/masterdata/viewgroups/v1/chain/1/viewGroupId');

echo $response->getBody();
```

```csharp ViewGroups_getViewGroupByIdAndChain_example
using RestSharp;

var client = new RestClient("https://api.fiftytwo.com/masterdata/viewgroups/v1/chain/1/viewGroupId");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift ViewGroups_getViewGroupByIdAndChain_example
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fiftytwo.com/masterdata/viewgroups/v1/chain/1/viewGroupId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```