# 轻享

# 创建轻享

# 接口调用说明:

POST https://lxapi.lexiangla.com/cgi-bin/v1/shares

# 请求document

创建轻享(在指定K吧)

{
  "data": {
    "attributes": {
      "content": "接口创建轻享,发表K吧", 
      "media_type": "link", 
      "media_data": {
        "pic_url": "https://lexiangla.com//favicon.ico", 
        "link": "https://lexiangla.com", 
        "title": "接口创建"
      }
    }, 
    "relationships": {
      "module": {
        "type": "team", 
        "id": "8d9ff3eedab611e9a4540a58ac1303ea"
      }, 
      "topics": [
        {
          "type": "topic", 
          "id": 1
        }, 
        {
          "type": "topic", 
          "id": 2
        }
      ]
    }
  }
}

# SDK封装方法使用示例

$options = [
    "content" => "php创建轻享,发表K吧",
    "media_type" => "link",
    "media_data" => [
        "pic_url" => "https://lexiangla.com/favicon.ico",
        "link" => "https://lexiangla.com",
        "title" => "链接标题",
    ],
    "team_id" => "8d9ff3eedab611e9a4540a58ac1303ea",
    "topic_ids" => [1, 2],
];
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->postShare($staff_id, $options);

multimedia 多媒体内容,其中图片 (opens new window)视频 (opens new window)都需要先调用乐享开放接口上传获取资源地址和ID。 当多媒体类型为链接时,即当 media_typelink 时,media_data的请求:

创建轻享(轻享广场)

{
  "data": {
    "attributes": {
      "content": "接口创建link", 
      "media_type": "link", 
      "media_data": {
        "pic_url": "https://lexiangla.com//favicon.ico", 
        "link": "https://lexiangla.com", 
        "title": "接口创建"
      }
    }
  }
}

# SDK封装方法使用示例

$options = [
    "content" => "php创建link",
    "media_type" => "link",
    "media_data" => [
        "pic_url" => "https://lexiangla.com/favicon.ico",
        "link" => "https://lexiangla.com",
        "title" => "链接标题",
    ]
]
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->postShare($staff_id, $options);

当多媒体类型为图片时,即当 media_typeimage 时,media_data的请求: 创建轻享(上传图片)

{
  "data": {
    "attributes": {
      "content": "接口创建image", 
      "media_type": "image", 
      "media_data": [
        {
          "url": "https://lexiangla.com/assets/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
        }, 
        {
          "url": "https://lexiangla.com/assets/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
        }
      ]
    }, 
    "relationships": {
      "topics": [
        {
          "type": "topic", 
          "id": 1
        }, 
        {
          "type": "topic", 
          "id": 2
        }
      ]
    }
  }
}

# SDK封装方法使用示例

$options = [
    "content" => "php创建image",
    "media_type" => "image",
    "media_data" => [
        "image_url" => [
            "https://tencent.lexiangla.com/wiki/logo.png",
            "https://tencent.lexiangla.com/wiki/logo.png",
            "https://tencent.lexiangla.com/wiki/logo.png",
        ],
    ],
];
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->postShare($staff_id, $options);

当多媒体类型为视频时,即当 media_typevideo 时,media_data的请求: 创建轻享(上传视频)

{
  "data": {
    "attributes": {
      "content": "接口创建video", 
      "media_type": "video", 
      "media_data": {
        "id": "31505e48111a11ec9a215a4b680fb277"
      }
    }, 
    "relationships": {
      "topics": [
        {
          "type": "topic", 
          "id": 1
        }, 
        {
          "type": "topic", 
          "id": 2
        }
      ]
    }
  }
}

# SDK封装方法使用示例

$options = [
    "content" => "php创建video",
    "media_type" => "video",
    "media_data" => [
        "video_id" => "31505e48111a11ec9a215a4b680fb277",
    ],
    "topic_id" => [1, 2],
];
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->postShare($staff_id, $options);

# 参数说明

参数名称 是否必须 默认值 说明
data.type 必须为share,表示轻享
data.attributes.content 轻享正文内容,若无则要求必须有多媒体内容
data.attributes.media_type 多媒体的类型如 image,video,link 等,其中 image 和 video 等类型需要提前访问内容多媒体接口获取。
data.attributes.media_data 多媒体内容,详细的见下文
data.relationships.module 轻享所属的板块,默认为全公司,type为team时,表示在归属k吧
data.relationships.module.type 目前支持team
data.relationships.module.team.id k吧id
data.relationships.topics 关联的话题数组
data.relationships.topics.id 话题id,需要先调用下文话题接口获得话题id
data.relationships.topics.type 必须为topic 表示为话题

media_typelink 时, media_data字段类型为对象,参数说明:

参数名称 是否必须 默认值 说明
pic_url 链接显示的图片
link 链接内容
title 链接标题

media_typeimage 时,media_data字段类型为对象,参数说明:

参数名称 是否必须 默认值 说明
url 图片地址

media_typevideo 时,media_data字段类型为对象,参数说明:

参数名称 是否必须 默认值 说明
id 视频 id

# 响应document

# 201 Created 状态码
{
  "data": {
    "type": "share", 
    "id": "01e55c266ddb11ec9a84de3fb47cb719", 
    "attributes": {
      "content": "接口创建video", 
      "summary": "接口创建video", 
      "created_at": "2022-01-05 11:53:13", 
      "media_type": "video", 
      "media_data": {
        "id": "dcc75aec6dd611ec99755e20051aadd1", 
        "vod_cover_url": "https://xxxxxxxxxx.vod2.myqcloud.com/8b973c82vodtransgzp1252005255/38d7d380387702294095xxxxxx/coverBySnapshot/coverBySnapshot_10_0.jpg"
      }
    }, 
    "relationships": {
      "owner": {
        "data": {
          "type": "staff", 
          "id": "sanzhang"
        }
      }, 
      "topics": {
        "data": [
          {
            "type": "topic", 
            "id": 1
          }, 
          {
            "type": "topic", 
            "id": 2
          }
        ]
      }
    }
  }, 
  "included": [
    {
      "type": "staff", 
      "id": "sanzhang", 
      "attributes": {
        "name": "张三", 
        "english_name": null, 
        "organization": "测试组"
      }
    }, 
    {
      "type": "topic", 
      "id": 1, 
      "attributes": {
        "content": "测试"
      }
    }, 
    {
      "type": "topic", 
      "id": 2, 
      "attributes": {
        "content": "测试2"
      }
    }
  ], 
  "links": {
    "self": "https://lxapi.lexiangla.com/cgi-bin/v1/shares/01e55c266ddb11ec9a84de3fb4xxxxxx"
  }
}

# 参数说明

参数 说明
attributes.content 轻享的内容
attributes.summary 轻享详情摘要
attributes.created_at 轻享的创建时间
attributes.media_type 多媒体的类型;如 image,video,link 等
relationships.owner.id 轻享的创建人id
relationships.topic.id 轻享的话题id
included.attributes.name 轻享创建者的的名字
included.attributes.english_name 轻享创建者的的英文名
included.attributes.organization 轻享创建者的所属部门

# 删除轻享

# 接口调用说明:

DELETE https://lxapi.lexiangla.com/cgi-bin/v1/shares/{share_id}

# 参数说明

参数 是否必须 默认值 说明
share_id 轻享的id

# SDK封装方法使用示例

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->deleteShare($staff_id, $share_id);

# 响应document

# 204 No Content 状态码

[]

# 404 Not Found 状态码

{
    "errors":[
        {
            "detail":"不存在ID为``的share资源"
        }
    ]
}

# 获取单条轻享

# 接口调用说明:

GET https://lxapi.lexiangla.com/cgi-bin/v1/shares/{share_id}

# 参数说明:

参数 是否必须 默认值 说明
share_id 轻享id

# SDK封装方法使用示例

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->forStaff($staff_id)->get("/shares/$share_id");

# 响应document

# 200 OK 状态码

{
  "data": {
    "type": "share", 
    "id": "a3f77f086dd611ec81f302932a06edd3", 
    "attributes": {
      "content": "创建轻享", 
      "summary": "创建轻享", 
      "multimedia": null, 
      "is_top": false, 
      "like_count": 1, 
      "like_type_count": [
        1
      ], 
      "reply_count": 1, 
      "created_at": "2022-01-05 11:21:58"
    }, 
    "relationships": {
      "owner": {
        "data": {
          "type": "staff", 
          "id": "sanzhang"
        }
      }, 
      "likes": {
        "data": [
          {
            "type": "share_like", 
            "id": "d0282bf46dd611ecbd18769b5d2021e1"
          }
        ]
      }, 
      "topics": {
        "data": [
          {
            "type": "topic", 
            "id": 1
          }
        ]
      }
    }
  }, 
  "included": [
    {
      "type": "staff", 
      "id": "sanzhang", 
      "attributes": {
        "name": "张三", 
        "english_name": null, 
        "organization": "设计部"
      }
    }, 
    {
      "type": "share_like", 
      "id": "d0282bf46dd611ecbd18769b5d2021e1", 
      "attributes": {
        "like_type": "GRINNING_FACE"
      }, 
      "relationships": {
        "staff": {
          "data": {
            "type": "staff", 
            "id": "sili"
          }
        }
      }
    }, 
    {
      "type": "topic", 
      "id": 1, 
      "attributes": {
        "content": "测试"
      }
    }
  ], 
  "links": {
    "self": "https://lxapi.lexiangla.com/cgi-bin/v1/shares/a3f77f086dd611ec81f302932axxxxxx"
  }
}

# 参数说明

参数 说明
attributes.content 轻享的内容
attributes.summary 轻享详情摘要
attributes.created_at 轻享的创建时间
attributes.multimedia 多媒体内容;如:图片、视频或链接
attributes.is_top 轻享是否置顶
attributes.like_count 轻享点赞总数
attributes.like_type_count 轻享每种表情点赞的数(点赞后,接口获取同步有点延缓)
attributes.reply_count 轻享评论数(不统计评论回复)
relationships.owner.id 轻享的创建人id
relationships.likes.id 轻享的点赞id
relationships.topic.id 轻享的话题id
included.attributes.name 轻享创建者的的名字
included.attributes.english_name 轻享创建者的的英文名
included.attributes.organization 轻享创建者的所属部门

# 获取轻享列表

# 接口调用说明:

GET https://lxapi.lexiangla.com/cgi-bin/v1/shares

# 参数说明:

支持分页参数和排序:(通用说明?

支持时间范围过滤

参数 是否必须 默认值 说明
module_type 为team,表示获取某k吧归属下的轻享
module_id module_type为team时,为k吧id
per_page 分页参数,默认为 20
page 默认为 1

# SDK封装方法使用示例

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->forStaff($staff_id)->get("/shares", [
    //"module_type" => "team",
    //"module_id" => "$module_id",
]);

# 响应document

# 200 OK 状态码

{
  "data": [
    {
      "type": "share", 
      "id": "f8f683e66dd611ecb108fe63efce4656", 
      "attributes": {
        "content": "创建轻享2", 
        "summary": "创建轻享2", 
        "multimedia": null, 
        "is_top": false, 
        "like_count": 0, 
        "like_type_count": null, 
        "reply_count": 0, 
        "created_at": "2022-01-05 11:24:20"
      }, 
      "relationships": {
        "owner": {
          "data": {
            "type": "staff", 
            "id": "LX001"
          }
        }, 
        "topics": {
          "data": [
            {
              "type": "topic", 
              "id": 1
            }, 
            {
              "type": "topic", 
              "id": 2
            }
          ]
        }
      }
    }, 
    {
      "type": "share", 
      "id": "ddcd7f846dd611ec978b7ea090660e22", 
      "attributes": {
        "content": "", 
        "summary": "", 
        "is_top": false, 
        "like_count": 0, 
        "like_type_count": null, 
        "reply_count": 0, 
        "created_at": "2022-01-05 11:23:35", 
        "media_type": "video", 
        "media_data": {
          "id": "dcc75aec6dd611ec99755e20051aadd1", 
          "vod_cover_url": "https://xxxxxxxxxx.vod2.myqcloud.com/8b973c82vodtransgzp1252005255/38d7d38038770229409587xxxx/coverBySnapshot/coverBySnapshot_10_0.jpg"
        }
      }, 
      "relationships": {
        "owner": {
          "data": {
            "type": "staff", 
            "id": "sanzhang"
          }
        }
      }
    }, 
    {
      "type": "share", 
      "id": "ca861fe46dd611ecb25ac2ffd8959bd0", 
      "attributes": {
        "content": "<img class=\"lx-expression\" src=\"//static.lexiang-asset.com/build/img/face-v2/expression14-e606e20783.png\" alt=\"/微笑 \"/><img class=\"lx-expression\" src=\"//static.lexiang-asset.com/build/img/face-v2/expression14-e606e20783.png\" alt=\"/微笑 \"", 
        "summary": "/微笑 /微笑", 
        "multimedia": null, 
        "is_top": false, 
        "like_count": 1, 
        "like_type_count": [
          1
        ], 
        "reply_count": 0, 
        "created_at": "2022-01-05 11:23:02"
      }, 
      "relationships": {
        "owner": {
          "data": {
            "type": "staff", 
            "id": "sanzhang"
          }
        }
      }
    }, 
    {
      "type": "share", 
      "id": "c55206326dd611eca21b8abea22628c9", 
      "attributes": {
        "content": "", 
        "summary": "", 
        "is_top": false, 
        "like_count": 1, 
        "like_type_count": [
          1
        ], 
        "reply_count": 0, 
        "created_at": "2022-01-05 11:22:54", 
        "media_type": "image", 
        "media_data": [
          {
            "url": "https://lexiangla.com/assets/c43545986dd611eca3d7ee848940xxxx", 
            "origin_url": "https://image.lexiang-asset.com/company_01dde298016211eba859525400xxxxxx/assets/2022/01/c3b9d8ae-6dd6-11ec-8cd5-1a6bcc957e15.jpg?sign=zoOAfmxSezzBGPkpPCxGHhoXUhJhPTEwMDI5MTYyJms9QUtJRE4yMmgydDZqV0pscEtMYWdsVVRSaWx6czFycjZvYWZ2JmU9MTY0MTk1Nzc3MiZ0PTE2NDEzNTI5NzImcj0xMjkyODE0NjIzJmY9L2NvbXBhbnlfMDFkZGUyOTgwMTYyMTFlYmE4NTk1MjU0MDAyZjEwMjAvYXNzZXRzLzIwMjIvMDEvYzNiOWQ4YWUtNmRkNi0xMWVjLThjZDUtMWE2YmNjOTU3ZTE1LmpwZyZiPWxleGlhbmctMTAwMjkxNjI="
          }, 
          {
            "url": "https://lexiangla.com/assets/c438feb86dd611eca99e7e7a6a53xxxx", 
            "origin_url": "https://image.lexiang-asset.com/company_01dde298016211eba859525400xxxxxx/assets/2022/01/c3ba932a-6dd6-11ec-9877-1a6bcc957e15.jpg?sign=4r5r7NKvM+cmAv/9gyeMVqPaOXlhPTEwMDI5MTYyJms9QUtJRE4yMmgydDZqV0pscEtMYWdsVVRSaWx6czFycjZvYWZ2JmU9MTY0MTk1Nzc3MiZ0PTE2NDEzNTI5NzImcj0xMTMyMDYyOTUyJmY9L2NvbXBhbnlfMDFkZGUyOTgwMTYyMTFlYmE4NTk1MjU0MDAyZjEwMjAvYXNzZXRzLzIwMjIvMDEvYzNiYTkzMmEtNmRkNi0xMWVjLTk4NzctMWE2YmNjOTU3ZTE1LmpwZyZiPWxleGlhbmctMTAwMjkxNjI="
          }, 
          {
            "url": "https://lexiangla.com/assets/c43719046dd611ecadfe76d605a9xxxx", 
            "origin_url": "https://image.lexiang-asset.com/company_01dde298016211eba859525400xxxxxx/assets/2022/01/c3bb30c8-6dd6-11ec-a6c7-1a6bcc957e15.jpg?sign=UpH/qWl1Y5EkWqjfv/pPOSIdxaFhPTEwMDI5MTYyJms9QUtJRE4yMmgydDZqV0pscEtMYWdsVVRSaWx6czFycjZvYWZ2JmU9MTY0MTk1Nzc3MiZ0PTE2NDEzNTI5NzImcj0zNjcwNzI4NzAmZj0vY29tcGFueV8wMWRkZTI5ODAxNjIxMWViYTg1OTUyNTQwMDJmMTAyMC9hc3NldHMvMjAyMi8wMS9jM2JiMzBjOC02ZGQ2LTExZWMtYTZjNy0xYTZiY2M5NTdlMTUuanBnJmI9bGV4aWFuZy0xMDAyOTE2Mg=="
          }
        ]
      }, 
      "relationships": {
        "owner": {
          "data": {
            "type": "staff", 
            "id": "sanzhang"
          }
        }
      }
    }, 
    {
      "type": "share", 
      "id": "a3f77f086dd611ec81f302932a06edd3", 
      "attributes": {
        "content": "创建轻享", 
        "summary": "创建轻享", 
        "multimedia": null, 
        "is_top": false, 
        "like_count": 1, 
        "like_type_count": [
          1
        ], 
        "reply_count": 1, 
        "created_at": "2022-01-05 11:21:58"
      }, 
      "relationships": {
        "owner": {
          "data": {
            "type": "staff", 
            "id": "sanzhang"
          }
        }, 
        "topics": {
          "data": [
            {
              "type": "topic", 
              "id": 1
            }
          ]
        }
      }
    }
  ], 
  "links": {
    "first": "https://lxapi.lexiangla.com/cgi-bin/v1/shares?page=1", 
    "last": "https://lxapi.lexiangla.com/cgi-bin/v1/shares?page=1", 
    "prev": null, 
    "next": null
  }, 
  "meta": {
    "current_page": 1, 
    "from": 1, 
    "last_page": 1, 
    "path": "https://lxapi.lexiangla.com/cgi-bin/v1/shares", 
    "per_page": 20, 
    "to": 5, 
    "total": 5
  }, 
  "included": [
    {
      "type": "staff", 
      "id": "sanzhang", 
      "attributes": {
        "name": "张三", 
        "english_name": null, 
        "organization": "测试部"
      }
    }, 
    {
      "type": "topic", 
      "id": 1, 
      "attributes": {
        "content": "测试"
      }
    }, 
    {
      "type": "topic", 
      "id": 2, 
      "attributes": {
        "content": "测试2"
      }
    }
  ]
}

# 参数说明

参数 说明
attributes.content 轻享的内容
attributes.summary 轻享详情摘要
attributes.created_at 轻享的创建时间
attributes.multimedia 多媒体内容,可参考创建轻享类型的说明
attributes.media_type 多媒体的类型,如 image,video,link 等
attributes.media_data 多媒体内容
attributes.is_top 轻享是否置顶
attributes.like_count 轻享点赞总数
attributes.like_type_count 轻享每种表情点赞的数(点赞后,接口获取同步有点延缓)
attributes.reply_count 轻享评论数(不统计评论回复)
relationships.owner.id 轻享的创建人id
relationships.likes.id 轻享的点赞id
relationships.topic.id 轻享的话题id
included.attributes.name 轻享创建者的的名字
included.attributes.english_name 轻享创建者的的英文名
included.attributes.organization 轻享创建者的所属部门

# 创建轻享评论

# 接口调用说明:

POST https://lxapi.lexiangla.com/cgi-bin/v1/shares/{share_id}/replies

# 请求document

创建轻享评论

{
  "data": {
    "attributes": {
      "content": "接口添加评论"
    }
  }
}

# SDK封装方法使用示例

$attributes = [
    "content" => "php添加评论"
];
$shares_id = {share_id};
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->postShareReply($staff_id, $shares_id, $attributes);

创建轻享评论的回复

{
  "data": {
    "attributes": {
      "content": "接口回复"
    },
    "relationships": {
      "parent": {
        "type": "share_reply",
        "id": "8d9090a8055b11ecb0c14e09c0d10e53"
      }
    }
  }
}

# SDK封装方法使用示例

$attributes = [
    "content" => "php回复"
];
$shares_id = {share_id};
$options = [
    "parent_reply_id" => "8d9090a8055b11ecb0c14e09c0d10e53"
];
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->postShareReply($staff_id, $shares_id, $attributes,$options);

# 参数说明:

参数 是否必须 默认值 说明
data.type 必须为 share_reply
data.relationships.parent 父轻享评论,若为空,则为轻享一级评论
data.relationships.parent.id 父轻享评论id
data.relationships.parent.type 固定为share_reply

# 响应document

# 200 OK 状态码

{
  "data": {
    "type": "share_reply", 
    "id": "ae2242d06f9611ec90d7a2eef8c877a5", 
    "attributes": {
      "content": "接口测试评论回复", 
      "summary": "接口测试评论回复", 
      "created_at": "2022-01-07 16:49:09", 
      "updated_at": "2022-01-07 16:49:09"
    }, 
    "relationships": {
      "owner": {
        "data": {
          "type": "staff", 
          "id": "sanzhang"
        }
      }
    }
  }, 
  "included": [
    {
      "type": "staff", 
      "id": "sanzhang", 
      "attributes": {
        "name": "张三", 
        "english_name": null, 
        "organization": "设计部 "
      }
    }
  ]
}

# 参数说明

参数 说明
attributes.content 轻享的内容
attributes.summary 轻享详情摘要
attributes.created_at 轻享的创建时间
attributes.updated_at 轻享的更新时间
relationships.owner.id 轻享的创建人id
included.attributes.name 轻享创建者的的名字
included.attributes.english_name 轻享创建者的的英文名
included.attributes.organization 轻享创建者的所属部门

# 删除轻享回复

# 接口调用说明:

DELETE https://lxapi.lexiangla.com/cgi-bin/v1/shares/{share_id}/replies/{reply_id}

# SDK封装方法使用示例

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->deleteShareReply($staff_id, $share_id, $reply_id)

# 响应document

# 204 No Content 状态码

[]

# 获取轻享回复列表

# 接口调用说明:

GET https://lxapi.lexiangla.com/cgi-bin/v1/shares/{share_id}/replies

# 参数说明:

支持分页参数和排序:(通用说明?

支持时间范围过滤

参数 是否必须 默认值 说明
per_page 分页参数,默认为 20
page 默认为 1

# SDK封装方法使用示例

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->forStaff($staff_id)->get("/shares/$share_id/replies");

# 响应document

# 200 OK 状态码

{
  "data": [
    {
      "type": "share_reply", 
      "id": "26c9d7546dfb11ec967e1a2888xxxxxx", 
      "attributes": {
        "content": "接口评论", 
        "summary": "接口评论", 
        "created_at": "2022-01-05 15:43:19", 
        "updated_at": "2022-01-05 15:43:19"
      }, 
      "relationships": {
        "owner": {
          "data": {
            "type": "staff", 
            "id": "sanzhang"
          }
        }
      }
    }, 
    {
      "type": "share_reply", 
      "id": "e5df41306e0311ec93c47ea090xxxxxx", 
      "attributes": {
        "content": "回复接口的评论", 
        "summary": "回复接口的评论", 
        "created_at": "2022-01-05 16:45:56", 
        "updated_at": "2022-01-05 16:45:56"
      }, 
      "relationships": {
        "parent": {
          "data": {
            "type": "share_reply", 
            "id": "26c9d7546dfb11ec967e1a2888xxxxxx"
          }
        }, 
        "owner": {
          "data": {
            "type": "staff", 
            "id": "sili"
          }
        }
      }
    }
  ], 
  "links": {
    "first": "https://lxapi.lexiangla.com/cgi-bin/v1/shares/ee9f30186dfa11ecab427a5917xxxxxx/replies?page=1", 
    "last": "https://lxapi.lexiangla.com/cgi-bin/v1/shares/ee9f30186dfa11ecab427a5917xxxxxx/replies?page=1", 
    "prev": null, 
    "next": null
  }, 
  "meta": {
    "current_page": 1, 
    "from": 1, 
    "last_page": 1, 
    "path": "https://lxapi.lexiangla.com/cgi-bin/v1/shares/ee9f30186dfa11ecab427a5917xxxxxx/replies", 
    "per_page": 20, 
    "to": 2, 
    "total": 2
  }, 
  "included": [
    {
      "type": "share_reply", 
      "id": "26c9d7546dfb11ec967e1a2888xxxxxx", 
      "attributes": {
        "content": "接口评论", 
        "summary": "接口评论", 
        "created_at": "2022-01-05 15:43:19", 
        "updated_at": "2022-01-05 15:43:19"
      }, 
      "relationships": {
        "owner": {
          "data": {
            "type": "staff", 
            "id": "sanzhang"
          }
        }
      }
    }, 
    {
      "type": "staff", 
      "id": "sanzhang", 
      "attributes": {
        "name": "张三", 
        "english_name": null, 
        "organization": "测试部"
      }
    }, 
    {
      "type": "staff", 
      "id": "sili", 
      "attributes": {
        "name": "李四", 
        "english_name": null, 
        "organization": "开发部"
      }
    }
  ]
}

# 参数说明

参数 说明
attributes.content 轻享的内容
attributes.summary 轻享详情摘要
attributes.created_at 轻享的创建时间
attributes.updated_at 轻享的更新时间
relationships.owner.id 轻享的创建人id
included.attributes.name 轻享创建者的的名字
included.attributes.english_name 轻享创建者的的英文名
included.attributes.organization 轻享创建者的所属部门

# 点赞

# 接口调用说明:

POST https://lxapi.lexiangla.com/cgi-bin/v1/shares/{share_id}/likes

# 请求document

{
  "data": {
    "type": "share_like", 
    "attributes": {
      "like_type": "THUMBS_UP"
    }
  }
}

# 参数说明:

data.attributes.like_type 可以是以下五种点赞表情类型:

表情名称 表情
THUMBS_UP
RED_HEART
GRINNING_FACE
TEARS_OF_JOY
CLAPPING_HANDS

# SDK封装方法使用示例

$attributes = [
	"like_type" => "GRINNING_FACE",
];
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->postShareLike($staff_id, $share_id, $attributes);

# 响应document

# 201 Created 状态码

{
  "data": {
    "type": "share_like", 
    "id": "d0282bf46dd611ecbd18769b5d2021e1", 
    "attributes": {
      "like_type": "TEARS_OF_JOY"
    }
  }
}

####参数说明:

参数 说明
data.type.id 轻享点赞id
attributes.like_type 点赞表情类型

# 取消点赞

# 接口调用说明:

DELETE https://lxapi.lexiangla.com/cgi-bin/v1/shares/{share_id}/likes/{like_id}

####参数说明:

参数 是否必须 默认值 说明
share_id 轻享 id
like_id 点赞 id

# SDK封装方法使用示例

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->deleteShareLike($staff_id, $share_id, $like_id);

# 响应document

# 204 No Content 状态码

[]

# 创建话题

# 接口调用说明:

POST https://lxapi.lexiangla.com/cgi-bin/v1/topics

# 请求document

{
    "data":{
        "type":"topic",
        "attributes":{
            "content":"创建轻享话题"
        }
    }
}

####参数说明:

参数名称 是否必须 默认值 说明
data.type 必须为 topic 表示话题
data.attributes.content 轻享话题内容

# SDK封装方法使用示例

$attributes = [
	"content" => "创建轻享话题"
];
$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->postShareTopic($staff_id, $attributes);

# 响应document

# 201 Created 状态码

{
  "data": {
    "type": "topic", 
    "id": 3, 
    "attributes": {
      "content": "创建轻享话题"
    }
  }, 
  "links": {
    "self": "https://lxapi.lexiangla.com/cgi-bin/v1/topics/3"
  }
}

####参数说明:

参数 说明
data.type.id 轻享话题id
attributes.content 轻享话题内容

# 查询轻享话题

# 接口:

GET https://lxapi.lexiangla.com/cgi-bin/v1/topics/{topic_id}

# 参数说明

参数名称 是否必须 默认值 说明
topic_id 表示查询的话题id

# SDK封装方法使用示例

$Lxapi = new \Lexiangla\Openapi\Api(AppKey, AppSecret);
$response = $Lxapi->get("/topics/$topic_id");

# 响应document

# 200 OK 状态码

{
  "data": {
    "type": "topic", 
    "id": 3, 
    "attributes": {
      "content": "创建轻享话题"
    }
  }, 
  "links": {
    "self": "https://lxapi.lexiangla.com/cgi-bin/v1/topics/3"
  }
}

####参数说明:

参数 说明
data.type.id 轻享话题id
attributes.content 轻享话题内容