1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Libs\TikTok\OpenPlatform\Im;
- use App\Libs\TikTok\Kernel\BaseClient;
- class Client extends BaseClient
- {
- protected $headerAccessToken = true;
- /**
- * @param string $serviceOpenId 客服号 openid
- * @param array $param
- * @return array
- * @throws \App\Libs\TikTok\Kernel\Exceptions\HttpException
- * @throws \App\Libs\TikTok\Kernel\Exceptions\InvalidConfigException
- * @throws \GuzzleHttp\Exception\GuzzleException
- */
- public function sendMsg(string $serviceOpenId, array $param = []): array
- {
- $data = [
- 'conversion_id' => getProp($param, 'conversion_id'),
- 'send_url' => getProp($param, 'send_url'),
- 'to_user_id' => getProp($param, 'to_user_id'),
- 'msg_type' => (int)getProp($param, 'msg_type'),
- ];
- return $this->httpPostJson('/im/send/customer/service/msg/', $data, [
- 'open_id' => $serviceOpenId
- ]);
- }
- }
|