SFTP To Go의 API를 사용하여 SFTP To Go와 통합하고 SFTP To Go 설정 및 인증정보를 관리할 수 있습니다.

프로그래밍 방식으로 파일에 액세스하기 위해 SFTP, FTPS 또는 Amazon S3 라이브러리를 사용할 수 있습니다.

개요

SFTP To Go REST API는 표현 상태 전송 (REST) 설계 원칙을 따릅니다. API를 시작하기 위해 curl 명령줄 유틸리티를 사용하는 것을 권장합니다.

모든 API 호출은 다음으로 시작합니다:
https://api.sftptogo.com/organizations/${SFTPTOGO_ORGANIZATION_ID}

조직 ID는 SFTP To Go 인스턴스를 식별합니다. SFTP To Go에 로그인한 후 브라우저의 주소 표시줄에서 복사할 수 있습니다.

모든 API 액세스는 HTTPS를 통해 제공되며, 모든 데이터는 JSON 형식으로 전송되고 수신됩니다. API 호출에서 인수 데이터를 전달할 때 Content-type: application/json 헤더를 추가해야 합니다.

모든 API 호출은 Authorization 헤더에 API 키를 다음과 같이 전달하여 인증됩니다:
Authorization: Bearer ${SFTPTOGO_API_KEY}

API 키는 Heroku 애플리케이션에서 SFTPTOGO_API_KEY 환경 변수로 제공됩니다.

다음 문서에서는 다음 변수가 설정되어 있다고 가정합니다:

SFTPTOGO_API_KEY=<SFTPToGo API 키>
SFTPTOGO_ORGANIZATION_ID=<조직 ID>

API 참조

자격 증명

자격 증명 목록 조회

모든 자격 증명 목록을 가져옵니다.

GET api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users

예시:

curl --request GET \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json"

예시 출력:

Status: 200 OK
[
    {
        "Alias": "Root",
        "ChrootDirectory": "/",
        "CreatedAt": 1565537159609,
        "HomeDirectory": "/sftptg-prod-us-east-1-72e9cf24-be8c-4f15-9aa2-813281fb98fe",
        "Host": "warm-soda-25793.sftptogo.com",
        "Id": "4ddb2ea265b8eaf7685b4e125a1292",
        "UserName": "user-name",
        "IsDefault": true,
        "OrganizationId": "72e9cf24-be8c-4f15-9aa2-813281fb98fe",
        "Password": "my-secret-password",
        "PasswordCreatedAt": "2020-10-26T07:19:26.908Z",
        "Permission": "full",
        "Settings": {
            "Network": {
                "InboundRules": [
                    {
                        "Action": "allow",
                        "Description": "Allow all inbound traffic from anywhere",
                        "Id": "c1d91788-e46f-45a0-9c7b-386e90db000a",
                        "Protocol": "SFTP",
                        "Source": "0.0.0.0/0",
                        "State": "enabled"
                    }
                ]
            }
        },
        "SshPublicKeysCount": 1,
        "State": "active",
        "URI": "sftp://user-name:my-secret-password@warm-soda-25793.sftptogo.com",
        "UpdatedAt": 1605642318015
    }
]

자격 증명 생성

새로운 자격 증명을 생성합니다.

POST https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users

매개변수:

이름 유형 설명
Alias string 자격 증명의 이름 (로그인에 사용되지 않음)
UserName string 서버에 연결할 때 사용할 사용자 이름. 최소 10자, 최대 100자의 영숫자, 밑줄, 하이픈 또는 마침표 문자여야 합니다.
Password string 서버에 연결할 때 사용할 비밀번호. 조직 수준의 비밀번호 정책을 준수해야 합니다.
HomeDirectory string 사용자의 홈 디렉토리 - 클라이언트가 명시적으로 정의하지 않는 경우, 이것이 사용자의 기본 디렉토리입니다.
ChrootDirectory string 설정된 경우, HomeDirectory가 이 값에 매핑됩니다 (예: HomeDirectory를 /sales로 설정하고 ChrootDirectory를 /ventas로 설정하면, 사용자가 연결할 때 접근할 수 있는 단일 디렉토리 /ventas를 찾게 되며, 이는 실제 /sales 디렉토리에 매핑됩니다). 기본값은 /입니다 (사용자가 할당된 HomeDirectory 내에서 시작함을 의미).
Permission string none - 접근 권한 없음
read-only - 읽기만 가능, 쓰기 불가
read-write - 읽기 및 쓰기 가능
write-only - 쓰기만 가능, 읽기 불가
full - 읽기, 쓰기 및 홈 디렉토리 접근 가능
Expiration int 이 자격 증명이 자동으로 비활성화되는 날짜(유닉스 시간). 비워두면 만료되지 않습니다
State string active / inactive

예시 호출:

curl --request POST \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json" \
  --data '{
    "Alias": "Test Credential",
    "UserName": "my-user-name",
    "Password": "my-secret-password",
    "HomeDirectory": "/",
    "ChrootDirectory": "/",
    "Permission": "read-write",
    "State": "active"
  }'

예시 출력:

Status: 201 Created
{
    "Alias": "Test Credential",
    "ChrootDirectory": "/",
    "CreatedAt": 1616615059930,
    "HomeDirectory": "/",
    "Host": "warm-soda-25793.sftptogo.com",
    "Id": "cfc211269c8c0f925c64b1a223d8eb",
    "UserName": "my-user-name",
    "IsDefault": false,
    "OrganizationId": "72e9cf24-be8c-4f15-9aa2-813281fb98fe",
    "Password": "my-secret-password",
    "Permission": "read-write",
    "SshPublicKeysCount": 0,
    "Settings": {
        "Network": {
            "InboundRules": [
                {
                    "Action": "allow",
                    "Description": "Allow all inbound traffic from anywhere",
                    "Id": "c1d91788-e46f-45a0-9c7b-386e90db000a",
                    "Protocol": "SFTP",
                    "Source": "0.0.0.0/0",
                    "State": "enabled"
                }
            ]
        }
    },
    "State": "active",
    "URI": "sftp://my-user-name:my-secret-password@warm-soda-25793.sftptogo.com",
    "UpdatedAt": 1616615059930
}

자격 증명 조회

특정 자격 증명을 조회합니다.
GET https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID

예시 호출:

curl --request GET \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json"

예시 응답:

200 Ok
{
    "Alias": "Test Credential",
    "ChrootDirectory": "/",
    "CreatedAt": 1616615059930,
    "HomeDirectory": "/",
    "Host": "warm-soda-25793.sftptogo.com",
    "Id": "cfc211269c8c0f925c64b1a223d8eb",
    "IsDefault": false,
    "OrganizationId": "72e9cf24-be8c-4f15-9aa2-813281fb98fe",
    "Password": "my-secret-password",
    "Permission": "read-write",
    "SshPublicKeysCount": 0,
    "State": "active",
    "URI": "sftp://my-user-name:my-secret-password@warm-soda-25793.sftptogo.com",
    "UpdatedAt": 1616615059930,
    "UserName": "user-name"
}

자격 증명 업데이트

데이터 인수 내에서 업데이트에 필요한 키만 전달하여 기존 자격 증명을 업데이트합니다.
PATCH https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID

매개변수 - 자격 증명 생성 매개변수 참조

예시 호출:

curl --request PATCH \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json" \
  --data '{
    "Alias": "Test Credential (updated)",
    "HomeDirectory": "/test",
    "Permission": "read-write"
  }'

예시 응답:

Status: 200 OK
{
    "Alias": "Test Credential",
    "ChrootDirectory": "/",
    "CreatedAt": 1616615059930,
    "HomeDirectory": "test",
    "Host": "warm-soda-25793.sftptogo.com",
    "Id": "cfc211269c8c0f925c64b1a223d8eb",
    "UserName": "user-name",
    "IsDefault": false,
    "OrganizationId": "72e9cf24-be8c-4f15-9aa2-813281fb98fe",
    "Password": "my-secret-password",
    "Permission": "read-write",
    "SshPublicKeysCount": 0,
    "State": "active",
    "URI": "sftp://my-user-name:my-secret-password@warm-soda-25793.sftptogo.com",
    "UpdatedAt": 1616615059930
}

자격 증명 네트워크 인바운드 규칙 업데이트

특정 자격 증명의 네트워크 인바운드 규칙을 업데이트합니다. 이 호출은 이전에 설정된 모든 인바운드 규칙을 덮어씁니다.

PATCH https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID

매개변수:

이름 유형 설명
Settings.Network.InboundRules array 외부 IP가 이 자격 증명으로 서버에 연결할 수 있도록 제어하는 네트워크 인바운드 규칙 컬렉션
Settings.Network.InboundRules[].Id string 나중에 식별하는 데 사용할 수 있는 인바운드 규칙의 고유 식별자
Settings.Network.InboundRules[].Protocol string * / SFTP / FTPS
Settings.Network.InboundRules[].State string enabled / disabled
Settings.Network.InboundRules[].Action string allow로 설정해야 함
Settings.Network.InboundRules[].Source string 서버에 연결할 수 있는 단일 IP 주소 또는 CIDR 표기법의 IP 주소 범위
Settings.Network.InboundRules[].Description string 인바운드 규칙에 대한 설명

예시 호출:

curl --request PATCH \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json" \
  --data '{
    "Settings": {
        "Network": {
            "InboundRules": [
                {
                    "Action": "allow",
                    "Description": "Allow all inbound traffic from anywhere",
                    "Id": "c1d91788-e46f-45a0-9c7b-386e90db000a",
                    "Protocol": "SFTP",
                    "Source": "0.0.0.0/0",
                    "State": "enabled"
                }
            ]
        }
    }
  }'

예시 응답:

Status: 200 OK
{
    "Alias": "Test Credential",
    "ChrootDirectory": "/",
    "CreatedAt": 1616615059930,
    "HomeDirectory": "test",
    "Host": "warm-soda-25793.sftptogo.com",
    "Id": "cfc211269c8c0f925c64b1a223d8eb",
    "UserName": "user-name",
    "IsDefault": false,
    "OrganizationId": "72e9cf24-be8c-4f15-9aa2-813281fb98fe",
    "Password": "my-secret-password",
    "Permission": "read-write",
    "SshPublicKeysCount": 0,
    "State": "active",
    "URI": "sftp://my-user-name:my-secret-password@warm-soda-25793.sftptogo.com",
    "Settings": {
        "Network": {
            "InboundRules": [
                {
                    "Action": "allow",
                    "Description": "Allow all inbound traffic from anywhere",
                    "Id": "c1d91788-e46f-45a0-9c7b-386e90db000a",
                    "Protocol": "SFTP",
                    "Source": "0.0.0.0/0",
                    "State": "enabled"
                }
            ]
        }
    },
    "UpdatedAt": 1616615059930
}

자격 증명 삭제

특정 자격 증명을 삭제합니다. Root 자격 증명은 삭제할 수 없습니다.
DELETE https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID

예시 호출:

curl --request DELETE \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json"

예시 응답:

200 Ok  
{
    "Alias": "Test Credential",
    "ChrootDirectory": "/",
    "CreatedAt": 1616615059930,
    "HomeDirectory": "test",
    "Host": "warm-soda-25793.sftptogo.com",
    "Id": "cfc211269c8c0f925c64b1a223d8eb",
    "UserName": "user-name",
    "IsDefault": false,
    "OrganizationId": "72e9cf24-be8c-4f15-9aa2-813281fb98fe",
    "Password": "my-secret-password",
    "Permission": "read-write",
    "SshPublicKeysCount": 0,
    "State": "active",
    "URI": "sftp://my-user-name:my-secret-password@warm-soda-25793.sftptogo.com",
    "UpdatedAt": 1616615059930
}

비밀번호 순환

지정된 자격 증명의 비밀번호를 순환합니다. 열린 세션은 비밀번호 순환의 영향을 받지 않습니다. 순환 후 새 비밀번호를 얻으려면 조회 요청을 하세요.
POST https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID/credential-rotations

비밀번호는 조직의 비밀번호 정책을 준수해야 합니다.

예시 호출:

curl --request POST \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID/credential-rotations \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json"

예시 응답:

200 Ok
{
  "message": "Password set."
}

비밀번호 설정

지정된 자격 증명의 비밀번호를 설정합니다. 열린 세션은 비밀번호 순환의 영향을 받지 않습니다.
POST https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID/credential-rotations

비밀번호는 조직의 비밀번호 정책을 준수해야 합니다.

예시 호출:

curl --request POST \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID/credential-rotations \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json" \
  --data '{
    "Password": "VeryC0mplexP@ssw0rdThatMeetsThe8olicy"
  }'

예시 응답:

200 Ok
{
  "message": "Password set."
}

공개 SSH 키

특정 자격 증명의 공개 SSH 키 목록

기존 자격 증명과 연결된 모든 공개 SSH 키를 나열합니다.

GET https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID/ssh-public-keys

예시 호출:

curl --request GET \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID/ssh-public-keys \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json"

예시 응답:

200 Ok
[
    {
        "Comment": "ladybug@Ladybugs-MacBook-Pro.local",
        "CreatedAt": 1617354664883,
        "Fingerprint": "SHA256:RcoHnamHrApC",
        "Id": "97285e07-09fd-42de-a1d0-997a0818310a",
        "SshPublicKeyBody": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDS2KBmXgE...",
        "Type": "rsa",
        "UpdatedAt": 1617354664883,
        "UserId": "4ddb2ea265b8eaf7685b4e125a1292"
    }
]

SSH 키 추가

기존 자격 증명에 SSH 키를 추가합니다.

POST https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID/ssh-public-keys

매개변수:

이름 유형 설명
SshPublicKeyBody string ssh-rsa와 같이 암호화 유형에 대한 정보를 포함하는 SSH 공개 키

예시 호출:

curl --request POST \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID/ssh-public-keys \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json" \
  --data '{
    "SshPublicKeyBody": "key"
  }'

예시 응답:

Status: 201 Created
{
    "Comment": "ladybug@Ladybugs-MacBook-Pro.local",
    "CreatedAt": 1617354664883,
    "Fingerprint": "SHA256:RcoHnamHrApC",
    "Id": "97285e07-09fd-42de-a1d0-997a0818310a",
    "SshPublicKeyBody": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDS2KBmXgE...",
    "Type": "rsa",
    "UpdatedAt": 1617354664883,
    "UserId": "4ddb2ea265b8eaf7685b4e125a1292"
}

SSH 키 제거

자격 증명에서 기존 SSH 키를 제거합니다.

DELETE https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID/ssh-public-keys/$KEY_ID

예시 호출:

curl --request DELETE \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/users/$CREDENTIAL_ID/ssh-public-keys/$KEY_ID \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json"

예시 응답:

Status 200, Ok
{
    "Comment": "ladybug@Ladybugs-MacBook-Pro.local",
    "CreatedAt": 1617354664883,
    "Fingerprint": "SHA256:RcoHnamHrApC",
    "Id": "97285e07-09fd-42de-a1d0-997a0818310a",
    "SshPublicKeyBody": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDS2KBmXgE...",
    "Type": "rsa",
    "UpdatedAt": 1617354664883,
    "UserId": "4ddb2ea265b8eaf7685b4e125a1292"
}

웹훅

웹훅 목록

모든 웹훅 목록을 가져옵니다.

예시:

curl --request GET \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/webhooks \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json"

예시 출력:

Status: 200 OK
[
    {
        "Id": "6b1c6f0c-52c1-47a6-9344-57a4579ced68",
        "Alias": "Test Webhook",
        "Url": "https://webhook.site/1b1b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b",
        "Type": "webhook",
        "AuthorizationHeader": "Bearer 123456789",
        "Secret": "",
        "Topics": ["file.created", "file.deleted", "file.downloaded"],
        "OrganizationId": "120ffd28-f115-7ce2-abc4-1e168c57c88a",
        "State": "enabled",
        "CreatedAt": 1561888254653,
        "UpdatedAt": 1561888254653
    }
]

웹훅 생성

새로운 웹훅을 생성합니다.

POST https://api.sftptogo.com/organizations/$ORGANIZATION_ID/webhooks

매개변수:

이름 유형 설명
Alias string 웹훅의 이름
Url string Webhook의 경우, 웹훅 알림을 받을 유효한 HTTPS URL이어야 합니다. Slack과 Teams의 경우, 유효한 인커밍 웹훅 URL이어야 합니다. Email의 경우, 유효한 이메일 주소여야 합니다.
Type string webhook - https 웹훅
slack - Slack 인커밍 웹훅
ms-teams - Microsoft Teams 웹훅
email - 이메일 웹훅
AuthorizationHeader string 선택적 인증 헤더
Topics array 구독할 주제 배열:
file.created - 파일 생성
file.deleted - 파일 삭제
file.downloaded - 파일 다운로드
State string enabled 또는 paused

예시 호출:

curl --request POST \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/webhooks \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json" \
  --data '{
    "Alias": "Test Webhook",
    "Url": "https://webhook.site/1b1b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b",
    "Type": "webhook",
    "AuthorizationHeader": "Bearer 123456789",
    "Topics": ["file.created", "file.deleted", "file.downloaded"],
    "State": "enabled"
  }'

예시 출력:

Status: 201 Created
{
    "Id": "6b1c6f0c-52c1-47a6-9344-57a4579ced68",
    "Alias": "Test Webhook",
    "Url": "https://webhook.site/1b1b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b",
    "Type": "webhook",
    "AuthorizationHeader": "Bearer 123456789",
    "Secret": "Some Secret",
    "Topics": ["file.created", "file.deleted", "file.downloaded"],
    "OrganizationId": "120ffd28-f115-7ce2-abc4-1e168c57c88a",
    "State": "enabled",
    "CreatedAt": 1561888254653,
    "UpdatedAt": 1561888254653
}

웹훅 업데이트

기존 웹훅을 업데이트합니다. 인수 JSON에서 업데이트에 필요한 키만 전달하세요.

매개변수 - 웹훅 생성 매개변수 참조

curl --request PATCH \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/webhooks/$WEBHOOK_ID \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json" \
  --data '{
    "Alias": "Test Updated Webhook"
  }'

예시 출력:

Status: 200 OK
{
    "Id": "6b1c6f0c-52c1-47a6-9344-57a4579ced68",
    "Alias": "Test Updated Webhook",
    "Url": "https://webhook.site/1b1b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b",
    "Type": "webhook",
    "AuthorizationHeader": "Bearer 123456789",
    "Secret": "Some Secret",
    "Topics": ["file.created", "file.deleted", "file.downloaded"],
    "OrganizationId": "120ffd28-f115-7ce2-abc4-1e168c57c88a",
    "State": "enabled",
    "CreatedAt": 1561888254653,
    "UpdatedAt": 1561888254653
}

웹훅 삭제

기존 웹훅을 삭제합니다.

DELETE https://api.sftptogo.com/organizations/$ORGANIZATION_ID/webhooks/$WEBHOOK_ID

예시 호출:

curl --request DELETE \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/webhooks/$WEBHOOK_ID \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json"

예시 응답:

200 OK
{}

공유 링크

공유 링크 목록

조직의 모든 공유 링크 목록을 가져옵니다.

GET https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/portal-links

예시 호출:

curl --request GET \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/portal-links \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json"

예시 응답:

Status: 200 OK
[
    {
        "UpdatedAt": 1739120350624,
        "ExpiresAt": null,
        "Permission": "read-only",
        "State": "active",
        "Type": "share",
        "AccessCount": 4,
        "OrganizationId": "97285e07-09fd-42de-a1d0-997a0818310a",
        "Url": "https://portal.sftptogo.com/p/shares/BSsdas5CBscVy",
        "Notes": null,
        "Path": "/path/to/file",
        "AccessLimit": 0,
        "CreatedBy": {
            "Type": "Admin",
            "Id": "ddhSx5LspkgKjiy",
            "PrincipalName": "John Doe",
            "PrincipalId": "a72d0ba096fas23f2",
            "PrincipalType": "admin"
        },
        "Id": "BSsdas5CBscVy",
        "CreatedAt": 1739117646540
    }
]

공유 링크 생성

파일 또는 폴더에 대한 새로운 공유 링크를 생성합니다.

POST https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/portal-links

매개변수:

이름 유형 설명
Path string 공유할 파일 또는 폴더의 경로. 폴더의 경우 슬래시로 끝나야 합니다 (예: /shared-folder/)
Permission string read-only - 읽기만 가능, 쓰기 불가
read-write - 읽기 및 쓰기 가능
write-only - 쓰기만 가능, 읽기 불가
read-write-no-delete - 읽기 및 쓰기 가능하지만 삭제 불가
ExpiresAt int 공유 링크가 만료되는 유닉스 타임스탬프. 만료 없음은 null로 설정
AccessLimit int 공유 링크에 접근할 수 있는 최대 횟수. 무제한은 0으로 설정. 한도에 도달하면 공유 링크가 자동으로 제거됨
Password string 공유 링크를 보호하기 위한 선택적 비밀번호. 조직의 비밀번호 정책을 준수해야 합니다. 설정된 경우 응답에서 반환됩니다.
Notes string 공유 링크를 쉽게 식별하는 데 도움이 되는 선택적 메모. 이 메모는 공유 권한이 있는 사람에게만 표시됩니다.
Type string share로 설정해야 함

예시 호출:

curl --request POST \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/portal-links \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json" \
  --data '{
    "Path": "/shared-folder/",
    "Permission": "read-write",
    "ExpiresAt": 1739120350624,
    "AccessLimit": 100,
    "Password": "SecureP@ss123",
    "Notes": "Q1 marketing materials",
    "Type": "share"
  }'

예시 응답:

Status: 201 Created
{
    "UpdatedAt": 1739120350624,
    "ExpiresAt": 1739120350624,
    "Permission": "read-write",
    "State": "active",
    "Type": "share",
    "AccessCount": 0,
    "OrganizationId": "97285e07-09fd-42de-a1d0-997a0818310a",
    "Url": "https://portal.sftptogo.com/p/shares/BSsdas5CBscVy",
    "Notes": "Q1 marketing materials",
    "Path": "/shared-folder/",
    "AccessLimit": 100,
    "Password": "SecureP@ss123",
    "CreatedBy": {
        "Type": "Account",
        "Id": "fas9e769-5033-413c-ade8-2d0620da824b",
        "Email": "admin@example.com",
        "Name": "Admin User"
    },
    "Id": "BSsdas5CBscVy",
    "CreatedAt": 1739117646540
}

공유 링크 조회

특정 공유 링크의 세부 정보를 조회합니다.

GET https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/portal-links/$SHARE_LINK_ID

예시 호출:

curl --request GET \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/portal-links/BSsdas5CBscVy \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json"

예시 응답:

Status: 200 OK
{
    "UpdatedAt": 1739120350624,
    "ExpiresAt": null,
    "Permission": "read-only",
    "State": "active",
    "Type": "share",
    "AccessCount": 4,
    "OrganizationId": "97285e07-09fd-42de-a1d0-997a0818310a",
    "Url": "https://portal.sftptogo.com/p/shares/BSsdas5CBscVy",
    "Notes": null,
    "Path": "/path/to/file",
    "AccessLimit": 0,
    "CreatedBy": {
        "Type": "Account",
        "Id": "fas9e769-5033-413c-ade8-2d0620da824b",
        "Email": "admin@example.com",
        "Name": "Admin User"
    },
    "Id": "BSsdas5CBscVy",
    "CreatedAt": 1739117646540
}

공유 링크 업데이트

기존 공유 링크를 업데이트합니다. 업데이트하려는 필드만 전달하세요.

PATCH https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/portal-links/$SHARE_LINK_ID

매개변수 - 공유 링크 생성 매개변수 참조

예시 호출:

curl --request PATCH \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/portal-links/BSsdas5CBscVy \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json" \
  --data '{
    "Permission": "read-write",
    "AccessLimit": 200,
    "Notes": "Updated Q1 marketing materials"
  }'

예시 응답:

Status: 200 OK
{
    "UpdatedAt": 1739120350624,
    "ExpiresAt": null,
    "Permission": "read-write",
    "State": "active",
    "Type": "share",
    "AccessCount": 4,
    "OrganizationId": "97285e07-09fd-42de-a1d0-997a0818310a",
    "Url": "https://portal.sftptogo.com/p/shares/BSsdas5CBscVy",
    "Notes": "Updated Q1 marketing materials",
    "Path": "/path/to/file",
    "AccessLimit": 200,
    "CreatedBy": {
        "Type": "Account",
        "Id": "fas9e769-5033-413c-ade8-2d0620da824b",
        "Email": "admin@example.com",
        "Name": "Admin User"
    },
    "Id": "BSsdas5CBscVy",
    "CreatedAt": 1739117646540
}

공유 링크 삭제

특정 공유 링크를 삭제합니다.

DELETE https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/portal-links/$SHARE_LINK_ID

예시 호출:

curl --request DELETE \
  --url https://api.sftptogo.com/organizations/$SFTPTOGO_ORGANIZATION_ID/portal-links/BSsdas5CBscVy \
  -H "Authorization: Bearer ${SFTPTOGO_API_KEY}" \
  -H "Content-type: application/json"

예시 응답:

Status: 200 OK
{}