Skip to main content

Attributions

What is an Attribution?

Attributions in Arttribute ensure that artists get proper credit when their work is used in AI. It is a core component that tracks and verifies the use of artworks according to the terms defined by the artist.

Key features of an Attribution include:

FeatureDescription
idUnique Identifier of an attribution.
attributorIdID of the user who made this attribution.
artifactIdID of the artifact being attributed.
collectionIdID of the collection being attributed.
isValidWhether the attribution is valid.
createdAtWhen the attribution was created (ISO 8601 timestamp).
updatedAtWhen the attribution was last updated.
expiresAtWhen the attribution expires (ISO 8601 timestamp).

Either artifactId or collectionId will be present in an attribution, but not both.


Making an Attribution

Step 1: Prepare the Attribution Data

Before making an attribution, gather all necessary information, including the artifact ID or the collection ID (depending on what resource is being attributed), the terms accepted, and the attributor's details.

Step 2: Make API request

With your attribution data ready, you can begin the attribution creation process. Below are code snippets illustrating how to structure your API request.

Making a Node JS request with axios for artifact attribution
const axios = require("axios");
let data = {
artifactId: "id-string",
};

axios
.request({
method: "post",
maxBodyLength: Infinity,
url: "https://api.arttribute.io/v2/attributions",
headers: {
"Content-Type": "application/json",
"x-authentication-address": address,
"x-authentication-message": message,
"x-authentication-signature": signature,
},
data: JSON.stringify(data),
})
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Making a Node JS request with axios for collection attribution
const axios = require("axios");
let data = {
collectionId: "id-string",
};

axios
.request({
method: "post",
maxBodyLength: Infinity,
url: "https://api.arttribute.io/v2/attributions",
headers: {
"Content-Type": "application/json",
"x-authentication-address": address,
"x-authentication-message": message,
"x-authentication-signature": signature,
},
data: JSON.stringify(data),
})
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});

Retrieving Attributions

Retrieving Attributions by ID

To retrieve an attribution by its ID, make a GET request to the /attributions/:id endpoint. Below is a code snippet illustrating how to structure your API request.

Making a Node JS request with axios
const axios = require("axios");

axios
.get(`https://api.arttribute.io/v2/attributions/${id}`)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});

Retrieving Attributions by User ID

To retrieve attributions by a user ID, make a GET request to the /users/:id/attributions endpoint. Below is a code snippet illustrating how to structure your API request.

Making a Node JS request with axios
const axios = require("axios");

axios
.get(`https://api.arttribute.io/v2/users/${id}/attributions`)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});

You can filter this down further to retrieve attributions for specifically artifacts or collections by adding the artifactId or collectionId.

Making a Node JS request with axios to get attributions for a specific artifact by a user
const axios = require("axios");

axios
.get(
`https://api.arttribute.io/v2/users/${userId}/attributions/artifact/${artifactId}`
)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Making a Node JS request with axios to get attributions for a specific collection by a user
const axios = require("axios");

axios
.get(
`https://api.arttribute.io/v2/users/${userId}/attributions/collection/${collectionId}`
)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});

Updating an Attribution

info

Under construction🚧

Deleting an Attribution

To delete an attribution, make a DELETE request to the /attributions/:id endpoint. Below is a code snippet illustrating how to structure your API request.

Making a Node JS request with axios
const axios = require("axios");

axios
.request({
method: "delete",
url: `https://api.arttribute.io/v2/attributions/${id}`,
headers: {
"x-authentication-address": address,
"x-authentication-message": message,
"x-authentication-signature": signature,
},
})
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});