Skip to main content
PUT
/
api
/
v1
/
directory_members
/
{member_id}
/
restore
Typescript (SDK)
import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.directory.directoryMemberRestore({
    memberId: 507482,
    directoryMemberRestore: {},
  });

  console.log(result);
}

run();
import os
from syllable_sdk import SyllableSDK


with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:

res = ss_client.directory.directory_member_restore(member_id=507482, directory_member_restore={})

# Handle response
print(res)
curl --request PUT \
--url https://api.syllable.cloud/api/v1/directory_members/{member_id}/restore \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"comments": "Restored"
}
'
const options = {
method: 'PUT',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({comments: 'Restored'})
};

fetch('https://api.syllable.cloud/api/v1/directory_members/{member_id}/restore', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.syllable.cloud/api/v1/directory_members/{member_id}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'comments' => 'Restored'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Syllable-API-Key: <api-key>"
],
]);

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

curl_close($curl);

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

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

func main() {

url := "https://api.syllable.cloud/api/v1/directory_members/{member_id}/restore"

payload := strings.NewReader("{\n \"comments\": \"Restored\"\n}")

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

req.Header.Add("Syllable-API-Key", "<api-key>")
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))

}
HttpResponse<String> response = Unirest.put("https://api.syllable.cloud/api/v1/directory_members/{member_id}/restore")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"comments\": \"Restored\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.syllable.cloud/api/v1/directory_members/{member_id}/restore")

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

request = Net::HTTP::Put.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"comments\": \"Restored\"\n}"

response = http.request(request)
puts response.read_body
{
  "name": "<string>",
  "type": "<string>",
  "id": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "extensions": [
    {
      "name": "work",
      "numbers": [
        {
          "number": "+1234567890",
          "rules": [
            {
              "language": "en"
            }
          ]
        }
      ]
    }
  ],
  "contact_tags": {
    "tag1": [
      "value1"
    ],
    "tag2": [
      "value2"
    ]
  },
  "comments": "Updated to add new extension",
  "deleted_at": null,
  "last_updated_by": "user@email.com",
  "created_by": "user@email.com"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Syllable-API-Key
string
header
required

Path Parameters

member_id
integer
required

Query Parameters

response_format
enum<string>
default:normalized

Directory response format for the restored member.

Available options:
normalized,
raw

Body

application/json

Request model to restore directory member.

comments
string
default:Restored

Comment stored in version history for this restore

Example:

"Restored"

Response

Successful Response

Model for a directory member (i.e. a contact).

name
string
required

Name of the directory member

Example:

"Jane Doe"

type
string
required

Type of the directory member

Example:

"Operator"

id
integer
required

Internal ID of the directory member

Example:

1

created_at
string<date-time>
required

When the contact was created

Example:

"2024-01-01T00:00:00Z"

updated_at
string<date-time>
required

Timestamp of most recent update

Example:

"2024-01-01T00:00:00Z"

extensions
DirectoryExtension · object[] | null

List of extensions for the directory member

Example:
[
{
"name": "work",
"numbers": [
{
"number": "+1234567890",
"rules": [{ "language": "en" }]
}
]
}
]
contact_tags
Contact Tags · object | null

Tags for the directory member

Example:
{ "tag1": ["value1"], "tag2": ["value2"] }
comments
string | null

The comments for the most recent edit to the directory member

Example:

"Updated to add new extension"

deleted_at
string<date-time> | null

When the contact was deleted, if deleted

Example:

null

last_updated_by
string | null

Email of the user who last updated the directory member

Example:

"user@email.com"

created_by
string | null

Email of the user who created the directory member

Example:

"user@email.com"