Update Engagement Account Group - MindBridge Documentation

Update Engagement Account Group

HTTP Request

PUT /v1/engagement-account-groups/{engagementAccountGroupId}

cURL

curl --request PUT \
  --url https://{tenant}.mindbridge.ai/api/v1/engagement-account-groups/{engagementAccountGroupId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '\n{\n  "code": "<string>",\n  "hidden": true,\n  "macCode": "<string>",\n  "alias": "<string>"\n}\n'```

### Python Example

```python
import requests

url = "https://{tenant}.mindbridge.ai/api/v1/engagement-account-groups/{engagementAccountGroupId}"

payload = {\n    "code": "<string>",\n    "hidden": True,\n    "macCode": "<string>",\n    "alias": "<string>"
}
headers = {\n    "Authorization": "Bearer <token>",\n    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)

JavaScript Example

const options = {\n  method: 'PUT',\n  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},\n  body: JSON.stringify({code: '<string>', hidden: true, macCode: '<string>', alias: '<string>'})\n};

fetch('https://{tenant}.mindbridge.ai/api/v1/engagement-account-groups/{engagementAccountGroupId}', options)
  .then(res => res.json())\n  .then(res => console.log(res))\n  .catch(err => console.error(err));

PHP Example

$curl = curl_init();

curl_setopt_array($curl, [\n  CURLOPT_URL => "https://{tenant}.mindbridge.ai/api/v1/engagement-account-groups/{engagementAccountGroupId}",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => "",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => "PUT",\n  CURLOPT_POSTFIELDS => json_encode([\n    'code' => '<string>',\n    'hidden' => true,\n    'macCode' => '<string>',\n    'alias' => '<string>'\n  ]),\n  CURLOPT_HTTPHEADER => [\n    "Authorization: Bearer <token>",\n    "Content-Type: application/json"\n  ],\n]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {\n  echo "cURL Error #:" . $err;\n} else {\n  echo $response;\n}

Go Example

package main

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

func main() {

url := "https://{tenant}.mindbridge.ai/api/v1/engagement-account-groups/{engagementAccountGroupId}"

payload := strings.NewReader("{\n  \"code\": \"<string>\",\n  \"hidden\": true,\n  \"macCode\": \"<string>\",\n  \"alias\": \"<string>\"\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
    req.Header.Add("Content-Type", "application/json")

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

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

fmt.Println(string(body))
}

C# Example

HttpResponse<String> response = Unirest.put("https://{tenant}.mindbridge.ai/api/v1/engagement-account-groups/{engagementAccountGroupId}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"code\": \"<string>\",\n  \"hidden\": true,\n  \"macCode\": \"<string>\",\n  \"alias\": \"<string>\"\n}")
  .asString();

Ruby Example

require 'uri'
require 'net/http'

url = URI("https://{tenant}.mindbridge.ai/api/v1/engagement-account-groups/{engagementAccountGroupId}")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"code\": \"<string>\",\n  \"hidden\": true,\n  \"macCode\": \"<string>\",\n  \"alias\": \"<string>\"\n}"

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

Response Structure

{
  "id": "<string>",
  "engagementAccountGroupingId": "<string>",
  "code": "<string>",
  "description": {},
  "lowestLevel": true,
  "hierarchy": ["<string>"],
  "parentCode": "<string>",
  "macCode": "<string>",
  "accountTags": ["<string>"],
  "publishedDate": "2023-11-07T05:31:56Z",
  "orderIndex": 123,
  "errors": [{"arguments": ["<string>"]}],
  "hidden": true,
  "alias": "<string>"
}

Body Parameters

Parameter Type Required Description
code string Yes The account code for this account group. Minimum string length: 1
hidden boolean Yes When true, this account is hidden and can't be used in account mapping.
macCode string No The MAC code mapped to this account group.
alias string No A replacement value used when displaying the account description.

Authorization

Authorization: Bearer authentication header of the form Bearer <token>, where <token> is your auth token.