Skip to main content

Shared Templates API

The Shared Templates API enables companies and partners to share and view templates across different partnerships. This API facilitates sharing specific templates with partners and retrieving the shared templates for a user and allowing the partner to create Dpps based on this template.


Endpoints

View Models

1. View Shared Templates

GET /view-shared-templates/:userId

Description:

Fetches a list of templates shared with the user based on their partnership status.

Parameters:

ParameterTypeDescription
userIdstringThe ID of the user to fetch shared templates for.

Response:

StatusDescription
200 OKSuccessfully fetched shared templates.
400 Bad RequestMissing or invalid userId.
404 Not FoundNo shared templates found for the user.
500 Internal Server ErrorAn error occurred while processing the request.

Response Object:

{
"success": true,
"message": "Shared templates fetched successfully.",
"templates": [
{
"id": "string",
"template_id": "string",
"partner_id": "string",
"company_id": "string",
"model_id": "string",
"company_name": "string",
"created_at": "string"
}
]
}

View Models
View Models

2. Share a Template

POST /share-template

Description:

Shares a specific template with a partner.

Request Body:

FieldTypeDescription
company_idstringThe ID of the company sharing the template.
template_idstringThe ID of the template to be shared.
partner_idstringThe ID of the partner to share the template with.

Response:

StatusDescription
200 OKTemplate shared successfully with the partner.
400 Bad RequestMissing required fields in the request body.
409 ConflictTemplate is already shared with the specified partner.
500 Internal Server ErrorAn error occurred while processing the request.

Response Object:

Success Response:

{
"success": true,
"message": "Template shared successfully with the partner.",
"data": {
"id": "string",
"template_id": "string",
"partner_id": "string",
"company_id": "string",
"created_at": "string"
}
}