Partners

A Partner is a first-class entity that cleanly represents an external organization, enables delegated administration, and enforces strict boundaries.

List Partners

SDK Method

partner.List()

Return Object

[]*Partner

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    "github.com/Files-com/files-sdk-go/v3/partner"
)

partnerIterator, err := partner.List(files_sdk.PartnerListParams{})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

for partnerIterator.Next() {
    partner := partnerIterator.partner()
}
err = partnerIterator.Err()
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Show Partner

SDK Method

partner.Find()

Return Object

Partner

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

PartnerFindParams Fields

FieldDescription
Id
int64
Required
Partner ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    "github.com/Files-com/files-sdk-go/v3/partner"
)

partner, err := partner.Find(files_sdk.PartnerFindParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Create Partner

SDK Method

partner.Create()

Return Object

Partner

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

PartnerCreateParams Fields

FieldDefaultDescription
AiAssistantPersonalityId
int64
AI Assistant Personality ID assigned to this Partner, if any. Users in the Partner inherit it unless a direct per-user assignment overrides it.
AllowedIps
string
A list of allowed IPs for this Partner. Newline delimited. Partner User IP access is allowed when the IP matches the Partner, User, or Site allowed IP lists.
AllowBypassing2faPolicies
boolean
falseAllow Partner Admins to change Two-Factor Authentication requirements for Partner Users.
AllowCredentialChanges
boolean
falseAllow Partner Admins to change or reset credentials for users belonging to this Partner.
AllowProvidingGpgKeys
boolean
falseAllow Partner Admins to provide GPG keys.
AllowUserCreation
boolean
falseAllow Partner Admins to create users.
CcEmailsToResponsibleParty
boolean
falseWhen true, emails sent to Partner users are copied to the responsible User or Group.
Notes
string
Notes about this Partner.
PartnerChannelTemplateId
int64
ID of the Partner Channel Template assigned to this Partner.
ResponsibleGroupId
int64
ID of the Group responsible for this Partner.
ResponsibleUserId
int64
ID of the User responsible for this Partner.
ShowPartnerChannelHomePage
boolean
falseShow Partner users a simplified home page built from this Partner's Channels.
Tags
string
Comma-separated list of Tags for this Partner. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
Name
string
Required
The name of the Partner.
RootFolder
string
Required
The root folder path for this Partner.
WorkspaceId
int64
0ID of the Workspace associated with this Partner.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    "github.com/Files-com/files-sdk-go/v3/partner"
)

partner, err := partner.Create(files_sdk.PartnerCreateParams{
  Name: "Acme Corp",
  RootFolder: "/AcmeCorp"
})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Update Partner

SDK Method

partner.Update()

Return Object

Partner

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

PartnerUpdateParams Fields

FieldDescription
Id
int64
Required
Partner ID.
AiAssistantPersonalityId
int64
AI Assistant Personality ID assigned to this Partner, if any. Users in the Partner inherit it unless a direct per-user assignment overrides it.
AllowedIps
string
A list of allowed IPs for this Partner. Newline delimited. Partner User IP access is allowed when the IP matches the Partner, User, or Site allowed IP lists.
AllowBypassing2faPolicies
boolean
Allow Partner Admins to change Two-Factor Authentication requirements for Partner Users.
AllowCredentialChanges
boolean
Allow Partner Admins to change or reset credentials for users belonging to this Partner.
AllowProvidingGpgKeys
boolean
Allow Partner Admins to provide GPG keys.
AllowUserCreation
boolean
Allow Partner Admins to create users.
CcEmailsToResponsibleParty
boolean
When true, emails sent to Partner users are copied to the responsible User or Group.
Notes
string
Notes about this Partner.
PartnerChannelTemplateId
int64
ID of the Partner Channel Template assigned to this Partner.
ResponsibleGroupId
int64
ID of the Group responsible for this Partner.
ResponsibleUserId
int64
ID of the User responsible for this Partner.
ShowPartnerChannelHomePage
boolean
Show Partner users a simplified home page built from this Partner's Channels.
Tags
string
Comma-separated list of Tags for this Partner. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
Name
string
The name of the Partner.
PartnershipRole
string
This site's role for this Partner in Connected Sites relationships. host is a Partner this site configured. guest is a Partner created by approving another site's connection request; it has no root folder and cannot hold users, permissions, or Partner Channels, or host a connection. host_and_guest is a configured Partner that is also the guest side of a connection. Promote a guest Partner by setting this to host_and_guest together with a root_folder.
Possible values: host, guest, host_and_guest
RootFolder
string
The root folder path for this Partner.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    "github.com/Files-com/files-sdk-go/v3/partner"
)

partner, err := partner.Update(files_sdk.PartnerUpdateParams{
  Id: 1,
  AiAssistantPersonalityId: 1
})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Delete Partner

SDK Method

partner.Delete()

Return Object

No return value.

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

PartnerDeleteParams Fields

FieldDescription
Id
int64
Required
Partner ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    "github.com/Files-com/files-sdk-go/v3/partner"
)

err := partner.Delete(files_sdk.PartnerDeleteParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

The Partner Object

Some of the methods above return a Partner object. The attributes of this object are listed below.

AttributeDescription
AllowBypassing2faPolicies
boolean
Allow Partner Admins to change Two-Factor Authentication requirements for Partner Users.
AllowedIps
string
A list of allowed IPs for this Partner. Newline delimited. Partner User IP access is allowed when the IP matches the Partner, User, or Site allowed IP lists.
AllowCredentialChanges
boolean
Allow Partner Admins to change or reset credentials for users belonging to this Partner.
AllowProvidingGpgKeys
boolean
Allow Partner Admins to provide GPG keys.
AllowUserCreation
boolean
Allow Partner Admins to create users.
CcEmailsToResponsibleParty
boolean
When true, emails sent to Partner users are copied to the responsible User or Group.
Connections
array(object)
Approved Connected Sites relationships for this Partner, in both directions. Empty when this Partner has no connections. Read-only.
Id
int64
The unique ID of the Partner.
AiAssistantPersonalityId
int64
AI Assistant Personality ID assigned to this Partner, if any. Users in the Partner inherit it unless a direct per-user assignment overrides it.
WorkspaceId
int64
ID of the Workspace associated with this Partner.
Name
string
The name of the Partner.
Notes
string
Notes about this Partner.
PartnerAdminIds
array(int64)
Array of User IDs that are Partner Admins for this Partner.
PartnerChannelTemplateId
int64
ID of the Partner Channel Template assigned to this Partner.
PartnershipRole
string
This site's role for this Partner in Connected Sites relationships. host is a Partner this site configured. guest is a Partner created by approving another site's connection request; it has no root folder and cannot hold users, permissions, or Partner Channels, or host a connection. host_and_guest is a configured Partner that is also the guest side of a connection. Promote a guest Partner by setting this to host_and_guest together with a root_folder.
Possible values: host, guest, host_and_guest
ResponsibleGroupId
int64
ID of the Group responsible for this Partner.
ResponsibleUserId
int64
ID of the User responsible for this Partner.
RootFolder
string
The root folder path for this Partner.
ShowPartnerChannelHomePage
boolean
Show Partner users a simplified home page built from this Partner's Channels.
Tags
string
Comma-separated list of Tags for this Partner. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
UserIds
array(int64)
Array of User IDs that belong to this Partner.