Datasources
Manages ownership of virtual objects in a user's collection
Last updated
Was this helpful?
Manages ownership of virtual objects in a user's collection
Last updated
Was this helpful?
Fetches a list of all organization datasources for the specified organization. Accepts an optional type query parameter to filter by datasource type.
/
default
The ID of an organization
Creates a new organization datasource in the provided organization. Returns the id of the created datasource.
NOTE: Adding support for a new NFT contract in the platform requires work from the platform team and must be sent as a support request.
/
The datasource's human readable name
Whether the datasource is public. If true, all objects in this datasource will be available to all users of the organization.
The type of the datasource - can either be 'undefined' or 'default'. WARNING: If set to 'default', objects created by users can be stored in this datasource. Not recommended unless this is the first datasource of the organization.
default
Create or update an MML Avatar ObjectDefinition with the provided assets
ObjectDefinitions. Returns the Datasource ID and ObjectDefinition ID of the created/updated avatar.
If avatar
is provided, the specified ObjectDefinition will be validated and if it is an MML Avatar, the specified assets will overwrite the existing assets.
/avatars/
The name of the created/updated MML Avatar. Must be between 1 and 64 characters
The location of an avatar ObjectDefinition
The assets that make up the avatar. Must contain at least 1 asset and at most 24 assets
Get a user's collection. A collection is made up of multiple ObjectDefinitions that are aggregated from:
A collection request can be filtered by properties, which will return only the ObjectDefinitions that match the root level of the specified properties.
/collections/
The ID of a user
The properties of an ObjectDefinition. Properties are key-value pairs where the key is always a string, and the value is either a string, boolean, integer, or another properties object. They can be nested.
{"value":{"avatar":"","avatarAsset":{"attachmentPoint":"head"}}}
The ID of an organization
Returns a list of unique properties for a user's collection. Only the root level properties of each object are returned.
e.g. If a user's collection contains the following objects: [ { "data": { "name": "Alice", "properties": { "age": 30 } } }, { "data": { "name": "Bob", "properties": { "age": 25 "address": { "city": "New York", "state": "NY" } } } } ]
The response will be: ["address", "age"]. "city" and "state" are not included in the response because they are nested properties below the root level.
/collections/properties/
The ID of an organization
Allows updating specific fields for an organization datasource.
/{datasourceId}//
The ID of a datasource
The datasource's human readable name
Whether the datasource is public. If true, all objects in this datasource will be available to all users of the organization.
The type of the datasource - can either be 'undefined' or 'default'. WARNING: If set to 'default', objects created by users can be stored in this datasource. Not recommended unless this is the first datasource of the organization.
default
No body
Deletes a datasource based on whether the X-M2-Organization-ID
header is set:
/{datasourceId}//
The ID of a datasource
The ID of an organization
No body
Add a new Object Definition to the specified organization datasource. The request body should contain the object definition data and optionally a list of files to be uploaded. The request should be a multipart/form-data
request.
/{datasourceId}/objectDefinitions/
The ID of a datasource
The ID of an organization
A raw MML string. Refer to https://mml.io/docs for how to create an MML string
The stringified properties of an ObjectDefinition
A file buffer or list of file buffers that represent a supported ObjectDefinition file type
Returns a list of all object definitions for the specified organization datasource.
/{datasourceId}/objectDefinitions/
The ID of a datasource
Number of documents to return per page
Unique id of the returned value object that the query should start after
Unique id of the returned value object that the query should end before
Filter by field and values. NOTE: This is not supported yet.
The ID of an organization
Empties the specified organization datasource, deleting all object definitions stored in it. This will only work for non-default organization datasources.
/{datasourceId}/objectDefinitions/
The ID of a datasource
The ID of an organization
No body
Retrieves the object definition if it exists for a given objectDefinitionId
in a datasource. This can be used to query for an object definition across organization or NFT datasources.
/{datasourceId}/objectDefinitions/{objectDefinitionId}//
The ID of a datasource
The ID of an object definition
Updates an object definition in an organization datasource. Any existing object definition URLs will be overwritten with the new data provided in the request body.
/{datasourceId}/objectDefinitions/{objectDefinitionId}//
The ID of a datasource
The ID of an object definition
The ID of an organization
No body
Deletes an object definition from an organization datasource.
/{datasourceId}/objectDefinitions/{objectDefinitionId}//
The ID of a datasource
The ID of an object definition
The ID of an organization
No body
Retrieves a CSV file with the list of users who own the specified object definition in the datasource.
/{datasourceId}/objectDefinitions/{objectDefinitionId}/userBalances/
The ID of a datasource
The ID of an object definition
Number of documents to return per page
Unique id of the returned value object that the query should start after
Unique id of the returned value object that the query should end before
Filter by field and values. NOTE: This is not supported yet.
The ID of an organization
Allows creation of multiple object definitions for an organization datasource in a single request. You cannot upload any files in this request, hence valid URLs must be provided in the data
field of each object definition in the request body.
The origin
field is not applicable for this endpoint.
/{datasourceId}/objectDefinitions/bulk/
The ID of a datasource
The ID of an organization
No body
Sets a user's balance for the specified object definition in the organization datasource to 0. This means the user will no longer see that object in their collection.
This will not work for an object in a public organization datasource.
/{datasourceId}/userBalances/delete/
The ID of a datasource
The ID of an object definition
No body
Enable or disable an NFT Datasource for the organization. If an NFT Datasource is enabled, users in the organization will see the NFT ObjectDefinitions in their collection. If disabled, users will not see NFT ObjectDefinitions from the NFT Datasource in their collection.
If operation is ADD
, the organization will support the NFT Datasource.
If operation is REMOVE
, the organization will no longer support the NFT Datasource, if already supported.
/external/
The ID of an organization
The ID of a datasource
The operation to perform on the external datasource, either 'ADD' or 'REMOVE'
No body
Triggers a NFT balance refresh for the calling user. The user's collection will be updated with the latest (supported) NFTs after a few seconds.
/nft/balance/refresh/
Request to refresh user balance
No body