Skip to content

Instantly share code, notes, and snippets.

@dhamkur
Last active July 5, 2022 04:31
Show Gist options
  • Save dhamkur/2803eec887a889466a58830bd4bc3c82 to your computer and use it in GitHub Desktop.
Save dhamkur/2803eec887a889466a58830bd4bc3c82 to your computer and use it in GitHub Desktop.
// Documentation Websocket Payload Sample
// Notes: For each available type creating, updating, and deleting
// For "creating" will be send all attributes to payload instead
// of "updating" only send changed attributes to payload
// For comment task and attachment task payload using same
// payload type: "comment"
// URL Connection: wss://cable.staging.virtualspace.ai:3334/cable?config=base64_result(token + auth_key)
// 1-A. Creating Project
/*
{
"message": "creating Project",
"payload": {
"archived_at": null,
"avatar": null,
"color_label": "#36f46d",
"created_at": "2022-06-29 17:58:24 GMT+0800",
"creator_id": "c437f1d7-2535-4b29-96c9-0b0a367ec6a5",
"id": "2d698f32-21f4-4a09-8e41-3635ba8d9d6c",
"initial_name": "tp2",
"name": "test project 2",
"project_by": "general",
"task_size": null,
"updated_at": "2022-06-29 17:58:24 GMT+0800",
"user_count": 1
},
"type": "Project"
}
*/
// 1-B. Updating Project
/*
{
"message": "updating Project",
"payload": {
"name": "test project 2.1",
"updated_at": "2022-06-29T17:59:58.647+08:00"
},
"type": "Project"
}
*/
// 1-C. Deleting Project
/*
{
"message": "deleting Project",
"payload": {
"archived_at": null,
"avatar": null,
"color_label": "#36f46d",
"created_at": "2022-06-29 17:58:24 GMT+0800",
"creator_id": "c437f1d7-2535-4b29-96c9-0b0a367ec6a5",
"id": "2d698f32-21f4-4a09-8e41-3635ba8d9d6c",
"initial_name": "tp2",
"name": "test project 2",
"project_by": "general",
"task_size": null,
"updated_at": "2022-06-29 17:58:24 GMT+0800",
"user_count": 1
},
"type": "Project"
}
*/
// 1-D. Presence Project
/*
{
"message": "presence sent",
"payload": {
"created_at": "2021-07-23 11:48:37 GMT+0800",
"updated_at": "2022-06-22 13:51:49 GMT+0800",
"id": "c437f1d7-2535-4b29-96c9-0b0a367ec6a5",
"email": "adham@virtualspirit.me",
"name": "Adham",
"country": "Indonesia",
"area_code": nil,
"phone_number": "+6285775791159",
"status_message": "Testing",
"availability_status": nil,
"timezone_area": "Asia/Jakarta",
"timezone_time": "+07:00",
"locale": nil,
"country_code": "62",
"avatar": "/uploads/public_store/14b9791e4a9c8fda69740150e1cce18d.jpg",
"availability_updated_at": nil,
"email_verification": false,
"is_complete": true,
"pubnub_object": nil
},
"status": "online",
"type": "ProjectPresence"
}
*/
// 2-A. Creating Section
/*
{
"message": "creating Section",
"payload": {
"created_at": "2022-06-29 18:18:44 GMT+0800",
"id": "5ab6d6f3-8491-48a1-9ba9-885fd5b5c670",
"name": "Test",
"position": 21,
"project_id": "0fb89697-ca05-4393-861a-37d7a5e92cd5",
"updated_at": "2022-06-29 18:18:44 GMT+0800"
},
"type": "Section"
}
*/
// 2-B. Updating Section
/*
{
"message": "updating Section",
"payload": {
"name": "test section 1",
"updated_at": "2022-06-29T18:28:54.559+08:00"
},
"type": "Section"
}
*/
// 2-C. Deleting Section
/*
{
"message": "deleting Section",
"payload": {
"created_at": "2022-06-29 18:18:44 GMT+0800",
"id": "5ab6d6f3-8491-48a1-9ba9-885fd5b5c670",
"name": "Test",
"position": 21,
"project_id": "0fb89697-ca05-4393-861a-37d7a5e92cd5",
"updated_at": "2022-06-29 18:18:44 GMT+0800"
},
"type": "Section"
}
*/
// 3-A. Creating Task
/*
{
"message": "creating Task",
"payload": {
"archived_at": null,
"commentable_count": null,
"comments_size": 0,
"created_at": "2022-06-29 18:31:32 GMT+0800",
"detail": "",
"due_date": null,
"due_time": null,
"id": "f1695454-2990-4cc5-8575-4653ee3b1cae",
"mark_done": false,
"name": "task 1",
"position": 1,
"priority": null,
"project_id": "2d698f32-21f4-4a09-8e41-3635ba8d9d6c",
"section_id": "a038081c-3cde-4fba-b5ec-60a7e26e272d",
"start_date": null,
"sub_task_count": null,
"tmptimetoken": null,
"updated_at": "2022-06-29 18:31:32 GMT+0800",
"user_id": "c437f1d7-2535-4b29-96c9-0b0a367ec6a5"
},
"type": "Task"
}
*/
// 3-B. Updating Task
/*
{
"message": "updating Task",
"payload": {
"name": "task 1.1",
"updated_at": "2022-06-29T18:32:30.566+08:00"
},
"type": "Task"
}
*/
// 3-C. Deleting Task
/*
{
"message": "deleting Task",
"payload": {
"archived_at": null,
"commentable_count": null,
"comments_size": 0,
"created_at": "2022-06-29 18:31:32 GMT+0800",
"detail": "",
"due_date": null,
"due_time": null,
"id": "f1695454-2990-4cc5-8575-4653ee3b1cae",
"mark_done": false,
"name": "task 1",
"position": 1,
"priority": null,
"project_id": "2d698f32-21f4-4a09-8e41-3635ba8d9d6c",
"section_id": "a038081c-3cde-4fba-b5ec-60a7e26e272d",
"start_date": null,
"sub_task_count": null,
"tmptimetoken": null,
"updated_at": "2022-06-29 18:31:32 GMT+0800",
"user_id": "c437f1d7-2535-4b29-96c9-0b0a367ec6a5"
},
"type": "Task"
}
*/
// 4-A. Creating SubTask
/*
{
"message": "creating SubTask",
"payload": {
"created_at": "2022-06-30 07:34:41 GMT+0800",
"due_date": null,
"id": "1054775e-8689-45df-8af9-226ef66fbbc4",
"mark_done": false,
"name": "testing",
"priority": null,
"start_date": null,
"updated_at": "2022-06-30 07:34:41 GMT+0800"
},
"type": "SubTask"
}
*/
// 4-B. Updating SubTask
/*
{
"message": "updating SubTask",
"payload": {
"name": "testing 123",
"updated_at": "2022-06-30T07:35:49.618+08:00"
},
"type": "SubTask"
}
*/
// 4-C. Deleting SubTask
/*
{
"message": "deleting SubTask",
"payload": {
"created_at": "2022-06-30 07:34:41 GMT+0800",
"due_date": null,
"id": "1054775e-8689-45df-8af9-226ef66fbbc4",
"mark_done": false,
"name": "testing",
"priority": null,
"start_date": null,
"updated_at": "2022-06-30 07:34:41 GMT+0800"
},
"type": "SubTask"
}
*/
// 5-A. Creating Checklist
/*
{
"message": "creating Checklist",
"payload": {
"created_at": "2022-06-30 07:36:39 GMT+0800",
"id": "c47bb270-c90a-4faa-9b0c-85c20cfa2791",
"mark_done": false,
"name": "testing",
"updated_at": "2022-06-30 07:36:39 GMT+0800"
},
"type": "Checklist"
}
*/
// 5-B. Updating Checklist
/*
{
"message": "updating Checklist",
"payload": {
"name": "testing 123",
"updated_at": "2022-06-30T07:37:26.540+08:00"
},
"type": "Checklist"
}
*/
// 5-C. Deleting Checklist
/*
{
"message": "deleting Checklist",
"payload": {
"created_at": "2022-06-30 07:36:39 GMT+0800",
"id": "c47bb270-c90a-4faa-9b0c-85c20cfa2791",
"mark_done": false,
"name": "testing",
"updated_at": "2022-06-30 07:36:39 GMT+0800"
},
"type": "Checklist"
}
*/
// 6-A. Creating Comment
/*
{
"message": "creating Comment",
"payload": {
"annotation_name": null,
"attachment": null,
"attachment_id": null,
"attachment_type": null,
"coordinate_x": null,
"coordinate_y": null,
"created_at": "2022-06-30 07:39:37 GMT+0800",
"display_name": null,
"filename": null,
"id": "94dc5db5-fafe-48f1-8b3b-89928a8a444f",
"mention": null,
"mention_attributes": null,
"read": false,
"text": "test comment create",
"updated_at": "2022-06-30 07:39:37 GMT+0800"
},
"type": "Comment"
}
*/
// 6-B. Updating Comment
/*
{
"message": "updating Comment",
"payload": {
"text": "test comment update",
"updated_at": "2022-06-30T07:40:19.380+08:00"
},
"type": "Comment"
}
*/
// 6-C. Deleting Comment
/*
{
"message": "deleting Comment",
"payload": {
"annotation_name": null,
"attachment": null,
"attachment_id": null,
"attachment_type": null,
"coordinate_x": null,
"coordinate_y": null,
"created_at": "2022-06-30 07:39:37 GMT+0800",
"display_name": null,
"filename": null,
"id": "94dc5db5-fafe-48f1-8b3b-89928a8a444f",
"mention": null,
"mention_attributes": null,
"read": false,
"text": "test comment create",
"updated_at": "2022-06-30 07:39:37 GMT+0800"
},
"type": "Comment"
}
*/
// 7-A. Creating Task Attachment - Type: Comment
/*
{
"message": "creating Comment",
"payload": {
"annotation_name": null,
"attachment": "https://api.staging.virtualspace.ai/api/v1/attachments/5d0c51dc-e496-43b9-8b6a-39237166641d",
"attachment_id": "07bf1576-910c-4a53-b904-a49633372763",
"attachment_type": "image",
"coordinate_x": null,
"coordinate_y": null,
"created_at": "2022-06-30 07:41:13 GMT+0800",
"display_name": "istockphoto-1290116527-1024x1024-3cde801c-9709-4220-abbd-063f223b5929.jpg",
"filename": "istockphoto-1290116527-1024x1024-3cde801c-9709-4220-abbd-063f223b5929.jpg",
"id": "51014b01-a0f9-47a8-9670-f6bcfc9ed7e6",
"mention": null,
"mention_attributes": null,
"read": false,
"text": "added new attachment",
"updated_at": "2022-06-30 07:41:13 GMT+0800"
},
"type": "Comment"
}
*/
// 7-A. Deleting Task Attachment - Type: Comment
/*
{
"message": "deleting Comment",
"payload": {
"annotation_name": null,
"attachment": "https://api.staging.virtualspace.ai/api/v1/attachments/5d0c51dc-e496-43b9-8b6a-39237166641d",
"attachment_id": "07bf1576-910c-4a53-b904-a49633372763",
"attachment_type": "image",
"coordinate_x": null,
"coordinate_y": null,
"created_at": "2022-06-30 07:41:13 GMT+0800",
"display_name": "istockphoto-1290116527-1024x1024-3cde801c-9709-4220-abbd-063f223b5929.jpg",
"filename": "istockphoto-1290116527-1024x1024-3cde801c-9709-4220-abbd-063f223b5929.jpg",
"id": "51014b01-a0f9-47a8-9670-f6bcfc9ed7e6",
"mention": null,
"mention_attributes": null,
"read": false,
"text": "added new attachment",
"updated_at": "2022-06-30 07:41:13 GMT+0800"
},
"type": "Comment"
}
*/
// 8-A. Invitation Project (Add Member Project)
/*
{
"message": "You have been invited to VirtualTest - 001",
"payload": {
"created_at": "2022-06-30T08:29:00.145+08:00",
"deleted_at": null,
"id": "f61ad6bf-0bad-473a-81b1-7a8286124fd8",
"project": {
"archived_at": null,
"avatar": null,
"color_label": "#6eebab",
"created_at": "2022-06-30 08:29:00 GMT+0800",
"creator_id": "01c20f42-df72-414d-bd5e-76703b13823d",
"id": "25f766b8-baa1-43db-8a34-9daaa3b28519",
"initial_name": "V-0",
"name": "VirtualTest - 001",
"project_by": "general",
"task_size": null,
"updated_at": "2022-06-30 08:29:00 GMT+0800",
"user_count": 1
},
"project_id": "25f766b8-baa1-43db-8a34-9daaa3b28519",
"updated_at": "2022-06-30T08:29:00.145+08:00",
"user": {
"area_code": null,
"availability_status": null,
"availability_updated_at": null,
"avatar": "https://virtualspace-backend-staging-public.s3.ap-southeast-1.amazonaws.com/images/14b9791e4a9c8fda69740150e1cce18d.jpg",
"country": "Indonesia",
"country_code": "62",
"created_at": "2021-07-23 11:48:37 GMT+0800",
"email": "adham@virtualspirit.me",
"email_verification": false,
"id": "c437f1d7-2535-4b29-96c9-0b0a367ec6a5",
"is_complete": true,
"locale": null,
"name": "Adham",
"phone_number": "+6285775791159",
"pubnub_object": {
"custom": {
"availability": "{\"status\":null,\"updateAt\":null}",
"phone": "+6285775791159",
"status": "Testing",
"timezone_area": "Asia/Jakarta",
"timezone_time": "+07:00"
},
"eTag": "AfqvtfO89dDgVA",
"email": "adham@virtualspirit.me",
"externalId": null,
"id": "c437f1d7-2535-4b29-96c9-0b0a367ec6a5",
"name": "Adham",
"profileUrl": "https://virtualspace-backend-staging-public.s3.ap-southeast-1.amazonaws.com/images/14b9791e4a9c8fda69740150e1cce18d.jpg",
"updated": "2021-12-14T05:12:34.713202Z"
},
"status_message": "Testing",
"timezone_area": "Asia/Jakarta",
"timezone_time": "+07:00",
"updated_at": "2022-06-28 16:21:33 GMT+0800"
},
"user_id": "c437f1d7-2535-4b29-96c9-0b0a367ec6a5"
},
"type": "ProjectCollabolator"
}
*/
// 8-B. Remove Member Project
/*
{
"message": "You have been deleted from VirtualTest - 001",
"payload": {
"created_at": "2022-06-30T08:29:00.145+08:00",
"deleted_at": null,
"id": "f61ad6bf-0bad-473a-81b1-7a8286124fd8",
"project": {
"archived_at": null,
"avatar": null,
"color_label": "#6eebab",
"created_at": "2022-06-30 08:29:00 GMT+0800",
"creator_id": "01c20f42-df72-414d-bd5e-76703b13823d",
"id": "25f766b8-baa1-43db-8a34-9daaa3b28519",
"initial_name": "V-0",
"name": "VirtualTest - 001",
"project_by": "general",
"task_size": null,
"updated_at": "2022-06-30 08:29:00 GMT+0800",
"user_count": 10
},
"project_id": "25f766b8-baa1-43db-8a34-9daaa3b28519",
"updated_at": "2022-06-30T08:29:00.145+08:00",
"user": {
"area_code": null,
"availability_status": null,
"availability_updated_at": null,
"avatar": "https://virtualspace-backend-staging-public.s3.ap-southeast-1.amazonaws.com/images/14b9791e4a9c8fda69740150e1cce18d.jpg",
"country": "Indonesia",
"country_code": "62",
"created_at": "2021-07-23 11:48:37 GMT+0800",
"email": "adham@virtualspirit.me",
"email_verification": false,
"id": "c437f1d7-2535-4b29-96c9-0b0a367ec6a5",
"is_complete": true,
"locale": null,
"name": "Adham",
"phone_number": "+6285775791159",
"pubnub_object": {
"custom": {
"availability": "{\"status\":null,\"updateAt\":null}",
"phone": "+6285775791159",
"status": "Testing",
"timezone_area": "Asia/Jakarta",
"timezone_time": "+07:00"
},
"eTag": "AfqvtfO89dDgVA",
"email": "adham@virtualspirit.me",
"externalId": null,
"id": "c437f1d7-2535-4b29-96c9-0b0a367ec6a5",
"name": "Adham",
"profileUrl": "https://virtualspace-backend-staging-public.s3.ap-southeast-1.amazonaws.com/images/14b9791e4a9c8fda69740150e1cce18d.jpg",
"updated": "2021-12-14T05:12:34.713202Z"
},
"status_message": "Testing",
"timezone_area": "Asia/Jakarta",
"timezone_time": "+07:00",
"updated_at": "2022-06-28 16:21:33 GMT+0800"
},
"user_id": "c437f1d7-2535-4b29-96c9-0b0a367ec6a5"
},
"type": "ProjectCollabolator"
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment