createFileAssociation
Creates a new file association
By passing in the appropriate options, you can create a new folder
/Files/{FileId}/Associations
Usage and SDK Samples
await xero.setTokenSet(tokenSet);
const xeroTenantId = 'YOUR_XERO_TENANT_ID';
const fileId = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const idempotencyKey = 'KEY_VALUE';
try {
const response = await xero.accountingApi.createFileAssociation(xeroTenantId, fileId, association, idempotencyKey);
console.log(response.body || response.response.statusCode)
} catch (err) {
const error = JSON.stringify(err.response.body, null, 2)
console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}
Scopes
files | Grant read-write access to files and folders |
Parameters
Name | Description |
---|---|
FileId* |
UUID
(uuid)
File id for single object
Required
|
Name | Description |
---|---|
xero-tenant-id* |
String
Xero identifier for Tenant
Required
|
Idempotency-Key |
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
Name | Description |
---|---|
association * |
Association
Required
|