metadata.find()
Retrieves the Metadata for an existing Group or User entity.
Definition
client.metadata.find(entityId: string|Group|User,organizationId: string,options: ?Object):Promise<Metadata,Error>
Parameters
| Parameter | Type | Description | 
|---|---|---|
entityId | string|Group|User | The entity that the metadata is associated with | 
organizationId | string | The Organization of the entity that the metadata is associated with; entities may have different metadata per organization | 
options | ?Object | Options (described below) | 
Options
| Parameter | Type | Description | 
|---|---|---|
ignoreNotFound | ?boolean | When the metadata does not exist: If true, return null; if false (default) throw an error | 
Returns
An error will be thrown if any of the arguments are invalid.
If the entity is not found, an error will be thrown with err.code equal to client.errors.NotFoundError.code.
Once the returned Promise is resolved, we will have access to a Metadata object.
Examples
try {const metadata = await client.metadata.find('some-group-id', 'some-org-id');console.log('found metadata', metadata);} catch (err) {if (err.code == client.errors.NotFoundError.code) {console.log('Entity not found');} else {console.log('Error');}}