Thanks Sir @ExtelligenceIT. Still its not working as expected for below json and for some of other json I have
{
"openapi": "3.0.1",
"info": {
"title": "Api",
"version": "1.0.25"
},
"servers": [
{
"url": "https://collections"
}
],
"paths": {
"/v1/Collections": {
"post": {
"tags": [
"Collections"
],
"summary": "Creates a new collection.",
"description": "Sample request\r\n\r\n POST /v1/\r\n {\r\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\r\n \"name\": \"Test Collection 43\",\r\n \"description\": \"Some test collection\",\r\n \"visibility\": \"Private\",\r\n \"createdOn\": \"2021-10-20T15:10:46.701Z\",\r\n \"modifiedOn\": \"2021-10-20T15:10:46.701Z\",\r\n \"cricutUserId\": 10009061,\r\n \"profileId\": \"60d0a756f5859d5b581c5237\"\r\n }",
"operationId": "CreateCollection",
"requestBody": {
"description": "The collection information",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CollectionViewModel"
}
}
}
},
"responses": {
"201": {
"description": "Created.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CollectionViewModel"
}
}
}
},
"400": {
"description": "Bad request. Collection information is missing.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"401": {
"description": "Not authenticated.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"402": {
"description": "Maximum free collections reached.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"403": {
"description": "Forbidden. Can't create a collection for another user.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
}
}
}
},
"/v1/Collections/{collectionId}": {
"get": {
"tags": [
"Collections"
],
"summary": "Retrieves the collection with the given collection id.",
"description": "Sample request\r\n\r\n GET /v1/e0585d30-31b5-11ec-8d3d-0242ac130003?size=100&token=10",
"operationId": "GetCollectionById",
"parameters": [
{
"name": "collectionId",
"in": "path",
"description": "The unique identifier for the collection",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "size",
"in": "query",
"description": "Specifies the number of items to return with the collection",
"required": true,
"schema": {
"maximum": 200,
"minimum": 1,
"type": "integer",
"format": "int32"
}
},
{
"name": "token",
"in": "query",
"description": "Specifies the current pagination token. This can be ignored on the initial page request.",
"schema": {
"type": "string"
}
},
{
"name": "itemTypes",
"in": "query",
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ItemType"
}
}
},
{
"name": "sortOrder",
"in": "query",
"schema": {
"$ref": "#/components/schemas/SortOrder"
}
}
],
"responses": {
"200": {
"description": "Success.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CollectionWithItemsViewModel"
}
}
}
},
"400": {
"description": "Bad request.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"401": {
"description": "Not authenticated.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"403": {
"description": "Forbidden.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"404": {
"description": "No collection found with the given id.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
}
}
},
"put": {
"tags": [
"Collections"
],
"summary": "Updates an existing collection.\r\nFields that can be updated include Name, Description, and Visibility",
"description": "Sample request\r\n\r\n PUT /v1/3fa85f64-5717-4562-b3fc-2c963f66afa6\r\n {\r\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\r\n \"name\": \"Test Collection 45\",\r\n \"description\": \"Some test collection\",\r\n \"visibility\": \"Private\",\r\n \"createdOn\": \"2021-10-20T15:10:46.701Z\",\r\n \"modifiedOn\": \"2021-10-20T15:10:46.701Z\",\r\n \"cricutUserId\": 10009061,\r\n \"profileId\": \"60d0a756f5859d5b581c5237\"\r\n }",
"operationId": "SaveCollection",
"parameters": [
{
"name": "collectionId",
"in": "path",
"description": "The id of the collection to update.",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"description": "The collection information.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CollectionViewModel"
}
}
}
},
"responses": {
"200": {
"description": "Success.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CollectionViewModel"
}
}
}
},
"400": {
"description": "Bad request.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"401": {
"description": "Not authenticated.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"403": {
"description": "Forbidden. Can't update a collection for another user.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"404": {
"description": "No collection found with the given id.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
}
}
},
"delete": {
"tags": [
"Collections"
],
"summary": "Deletes a collection.",
"description": "Sample Request:\r\n \r\n\tDELETE /v1/3fa85f64-5717-4562-b3fc-2c963f66afa6",
"operationId": "DeleteCollection",
"parameters": [
{
"name": "collectionId",
"in": "path",
"description": "The id of the collection to remove.",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"204": {
"description": "Success."
},
"400": {
"description": "Bad request.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"401": {
"description": "Not authenticated.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"403": {
"description": "Forbidden. Can't delete a collection for another user.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"404": {
"description": "No collection found with the given id.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
}
}
}
},
"/v1/Collections/{collectionId}/counts": {
"get": {
"tags": [
"Collections"
],
"summary": "Retrieves the items counts for the collection with the given collection id.",
"description": "Sample request\r\n\r\n GET /v1/e0585d30-31b5-11ec-8d3d-0242ac130003/counts",
"operationId": "GetCollectionCounts",
"parameters": [
{
"name": "collectionId",
"in": "path",
"description": "Id of the desired collection.",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Success.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CollectionWithItemsViewModel"
}
}
}
},
"400": {
"description": "Bad request.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"401": {
"description": "Not authenticated.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"403": {
"description": "Forbidden.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"404": {
"description": "No collection found with the given id.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
}
}
}
},
"/v1/Collections/{collectionId}/items": {
"put": {
"tags": [
"Collections"
],
"summary": "Adds an item to the given collection.",
"description": "Sample request\r\n\r\n PUT /v1/3fa85f64-5717-4562-b3fc-2c963f66afa6/items\r\n {\r\n \"itemType\": \"Project\",\r\n \"itemId\": \"3fa85f64\"\r\n }",
"operationId": "AddCollectionItem",
"parameters": [
{
"name": "collectionId",
"in": "path",
"description": "Id of the collection into which the item should be added.",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"description": "The collection item information.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CollectionItemRequest"
}
}
}
},
"responses": {
"200": {
"description": "Success."
},
"400": {
"description": "Bad request.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"401": {
"description": "Not authenticated.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"403": {
"description": "Forbidden. Can't update a collection for another user.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"404": {
"description": "No collection found with the given id.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"406": {
"description": "CricutValidationException occurred, such as the collection was already at max items.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
}
}
}
},
"/v1/Collections/{collectionId}/items/{itemType}/{itemId}": {
"delete": {
"tags": [
"Collections"
],
"summary": "Removes an item from the given collection.",
"description": "Sample request\r\n\r\n DELETE /v1/3fa85f64-5717-4562-b3fc-2c963f66afa6/items/Project/3fa85f64",
"operationId": "RemoveCollectionItem",
"parameters": [
{
"name": "collectionId",
"in": "path",
"description": "Id of the collection from which the item should be removed.",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "itemType",
"in": "path",
"description": "Item type, such as Project, Image, or Font.",
"required": true,
"schema": {
"$ref": "#/components/schemas/ItemType"
}
},
{
"name": "itemId",
"in": "path",
"description": "Id of the item to remove.",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "Success."
},
"400": {
"description": "Bad request.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"401": {
"description": "Not authenticated.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"403": {
"description": "Not authorized.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"404": {
"description": "No collection found with the given id.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
}
}
}
},
"/v1/Items/BulkInsert": {
"put": {
"tags": [
"Items"
],
"summary": "Bulk insert many items into 1 or more collections.",
"description": "Sample request\r\n\r\n PUT /v1/BulkInsert\r\n {\r\n \"collectionIds\": [ 3fa85f64-5717-4562-b3fc-2c963f66afa6 ],\r\n \"items\":[\r\n { \"itemType\": \"Project\", \"itemId\": \"5ecd4ecd8252320d08ad8453\" },\r\n { \"itemType\": \"Image\", \"itemId\": \"1234567\" },\r\n ]\r\n }",
"operationId": "BulkInsertIntoCollections",
"requestBody": {
"description": "A list of items and collectionIds into which the items should be inserted.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BulkInsertRequest"
}
}
}
},
"responses": {
"200": {
"description": "Success.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BulkInsertResponse"
}
}
}
},
"400": {
"description": "Bad request.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"401": {
"description": "Not authenticated.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"403": {
"description": "Not authorized.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"404": {
"description": "No items found with the given ids.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
}
}
}
},
"/v1/Items/BulkRemove": {
"post": {
"tags": [
"Items"
],
"summary": "Bulk remove many items from 1 or more collections.",
"description": "Sample request\r\n\r\n POST /v1/BulkRemove\r\n {\r\n \"collectionIds\": [ 3fa85f64-5717-4562-b3fc-2c963f66afa6 ],\r\n \"items\":[\r\n { \"itemType\": \"Project\", \"itemId\": \"5ecd4ecd8252320d08ad8453\" },\r\n { \"itemType\": \"Image\", \"itemId\": \"1234567\" },\r\n ]\r\n }",
"operationId": "BulkRemoveFromCollections",
"requestBody": {
"description": "A list of items and collectionIds from which the items should be removed.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BulkUpdateRequest"
}
}
}
},
"responses": {
"200": {
"description": "Success.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BulkUpdateResponse"
}
}
}
},
"400": {
"description": "Bad request.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"401": {
"description": "Not authenticated.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"403": {
"description": "Not authorized.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"404": {
"description": "No items found with the given ids.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
}
}
}
},
"/v1/User/{cricutUserId}/Collections": {
"get": {
"tags": [
"UserCollections"
],
"summary": "Retrieves a list of collections. Pagination available.",
"description": "Sample request\r\n \r\n GET /v1/User/10009061/Collections?numberOfLastAddedItems=10&token=1&size=100",
"operationId": "GetCollectionsByCricutUserId",
"parameters": [
{
"name": "numberOfLastAddedItems",
"in": "query",
"description": "Specifies the number of last added items to include for each collection.",
"schema": {
"maximum": 10,
"minimum": 0,
"type": "integer",
"format": "int32"
}
},
{
"name": "token",
"in": "query",
"description": "The offset to use for the results that will be returned.",
"schema": {
"type": "string"
}
},
{
"name": "size",
"in": "query",
"description": "The maximum number of results to return in the page.",
"schema": {
"maximum": 200,
"minimum": 1,
"type": "integer",
"format": "int32"
}
},
{
"name": "cricutUserId",
"in": "path",
"description": "CricutUserId of the collection owner.",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
}
],
"responses": {
"200": {
"description": "Success.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CollectionsViewModel"
}
}
}
},
"400": {
"description": "Bad request.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"401": {
"description": "Not authenticated.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"403": {
"description": "Forbidden.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"404": {
"description": "No collection found with the given project id.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
}
}
}
},
"/v1/User/{cricutUserId}/Collections/{itemType}/{itemId}": {
"get": {
"tags": [
"UserCollections"
],
"summary": "Retrieves a paginated list of collections for the given circutUserId that contain the given item.\r\nPagination available.",
"description": "Sample request\r\n \r\n GET /v1/User/10009061/Collections/collection/12345?numberOfLastAddedItems=0&token=1&size=100",
"operationId": "GetUserCollectionsByItem",
"parameters": [
{
"name": "itemType",
"in": "path",
"description": "The type of item to add/remove.",
"required": true,
"schema": {
"$ref": "#/components/schemas/ItemType"
}
},
{
"name": "itemId",
"in": "path",
"description": "The unique identifier of the item in the collection.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "numberOfLastAddedItems",
"in": "query",
"description": "Specifies the number of last added items to include for each collection.",
"schema": {
"maximum": 10,
"minimum": 0,
"type": "integer",
"format": "int32"
}
},
{
"name": "token",
"in": "query",
"description": "The offset to use for the results that will be returned.",
"schema": {
"type": "string"
}
},
{
"name": "size",
"in": "query",
"description": "The maximum number of results to return in the page.",
"schema": {
"maximum": 200,
"minimum": 1,
"type": "integer",
"format": "int32"
}
},
{
"name": "cricutUserId",
"in": "path",
"description": "CricutUserId of the collection owner.",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
}
],
"responses": {
"200": {
"description": "Request successful. Returns collectionsViewModel.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CollectionsViewModel"
}
}
}
},
"400": {
"description": "Bad request.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"401": {
"description": "Unauthorized.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"403": {
"description": "Forbidden.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CricutProblemDetails"
}
}
}
}
}
}
}
}
}