Introduction
The Delete Designs by UserId API is used to remove all designs associated with a specific user from the system. By passing the required parameters such as websiteId, webApiClientKey, and userId, the API identifies and deletes every design linked to that user account.
This API is particularly useful for maintaining data hygiene and ensuring that unwanted or unused designs are not retained in the system. It is typically triggered when a user removes customized products from the cart or when their session-related design data needs to be cleared. The operation helps optimize storage and ensures that only relevant and active design data is preserved within the platform.
Use Case
Cart Cleanup on Product Removal
When a user removes customized products from their cart, this API deletes all associated designs to prevent unnecessary data retention.
API Details
Endpoint
DELETE /api/4/Design/DeleteDesignsbyUserId
curl --location --request DELETE 'https://api.artifi.net/api/4/Design/DeleteDesignsbyUserId?userId=165' \
--header 'webApiClientKey: c961461a-bQWA287-448c-b9ea-e1162bd80b8e' \
--header 'websiteId: 422'
Parameters
Header validation
Header Name | Type | Required | Description |
websiteId | int | Yes | Unique identifier of the website. |
webApiClientKey | string | Yes | API client key used for authentication. |
Query Parameters
Name | Type | Required | Description |
userId | string | Yes | This parameter is a code that is associated with cliparts. Passing the Clipart Code in the API will delete the details of the associated clipart. |
Success Responses
{
"Response": "Success",
"Message": "Design deleted successfully.",
"Data": null,
"ErrorCode": ""
}
Error Code List (Click Here)
Q&A
Q1. What does the Delete Designs by UserId API do?
This API deletes all designs associated with a specific userId from the system. It ensures that no design data linked to that user remains after execution.
Q2. When should this Delete Designs by UserId API be used?
It should be used when a user removes customized products from their cart, when cleaning up unused design data, or when resetting a user’s design state due to errors or duplication.
Q3. Is it possible to delete a single design using this Delete Designs by UserId API ?
No, this API deletes all designs associated with the given userId. For deleting individual designs, a different API should be used.
Q4. What parameters are required to call this API?
The required parameters are:
- websiteId (Header)
- webApiClientKey (Header)
- userId (Query Parameter)
Q5. Is authentication required to use this API?
Yes, a valid webApiClientKey and websiteId must be provided in the request headers for authentication and authorization.
Q6. What happens if the userId does not exist?
If the provided userId does not exist or has no associated designs, the API will return a response indicating success or an appropriate message depending on the implementation, but no data will be deleted.
{
"Response": "Error",
"Message": "Invalid user id.",
"Data": null,
"ErrorCode": "227"
}
Q7 Does this API permanently delete the designs?
Yes, the deletion is permanent, and the designs cannot be recovered once deleted.
Q8. What response is returned on successful deletion?
On success, the API returns a response like:
{
"Response": "Success",
"Message": "Design deleted successfully.",
"Data": null,
"ErrorCode": ""
}