Guides
Dash CoreDash PlatformDash.orgDash User DocsLog In

🚧

New site!

All content has been migrated to docs.dash.org. You will be automatically redirected momentarily.

Usage: client.platform.documents.create(typeLocator, identity, documentOpts)
Description: This method will return a ExtendedDocument object initialized with the parameters defined and apply to the used identity.

Parameters:

parameterstyperequiredDescription
dotLocatorstringyesField of a specific application, under the form appName.fieldName
identityIdentityyesA valid registered identity
docOptsObjectyesA valid data that match the data contract structure

Example:

const identityId = '';// Your identity identifier
const identity = await client.platform.identities.get(identityId);

const helloWorldDocument = await client.platform.documents.create(
      // Assume a contract helloWorldContract is registered with a field note
      'helloWorldContract.note',
      identity,
     { message: 'Hello World'},
  );

Note: When your document is created, it will only exist locally, use the broadcast method to register it.

Returns: ExtendedDocument