1. 传输过程中加解密
AIRUDDER API
  • API 文档介绍
  • Introductions
  • 快速上手
  • Quick Start
  • 鉴权方法
    • 验证并获取令牌
      POST
  • Get the Authorization token
    • Token Authentication and Obtain
      POST
  • 全局错误代码
    • 全局错误代码
  • Error Codes
    • Error Codes
  • 催收
    • 快速上手
    • 调用任务相关 API
      • 创建外呼拨打任务
      • 列出已创建的任务
      • 停止一个呼叫任务
      • 取消指定任务中的某个电话的拨打
      • 任务结束状态通知
      • 任务电话维度拨打结束状态通知
      • 获取任务详细信息
      • 获取单个案件通话录音
      • 获取任务录音文件
      • 获取机器人列表
      • 根据callid获取电话信息和录音链接
      • 任务内AI转人工坐席成功时通知
    • 调用计划相关的API
      • 获取策略列表
      • 创建策略计划拨打任务
      • 获取计划状态信息
      • 获取计划内任务轮次信息
      • 列出已创建的任务
      • 停止一个呼叫任务
      • 取消计划中的某个电话的拨打
      • 计划结束状态通知
      • 任务结束状态通知
      • 任务电话维度拨打结束状态通知
      • 获取任务详细信息
      • 获取单个案件通话录音
      • 获取任务录音文件
      • 获取计划内某个电话所有的通话录音
      • 根据callid获取电话信息和录音链接
      • 获取机器人列表
  • Collection
    • Quick Start
    • APIs Related to Calling Tasks
      • Create a Calling Task
      • List the Task Created
      • Cancel a Calling Task
      • Cancel a Certain Call in a Specific Task
      • Webhook of Task
      • Webhook of Call
      • Obtain the Detailed Information of Tasks
      • Obtain a Call Recording
      • Obtain Call Recordings
      • Fetch robot list
      • Obtain call information and recording link by callid
    • APIs Related to Calling Plans
      • Obtain the List of Strategies
      • Create a Dialing Plan with Strategy
      • Obtain the Information of Plan Status
      • Obtain the Information of Each Round of the Plan
      • List the Task Created
      • Cancel a Calling Task
      • Cancel a Certain Call in a Plan
      • Webhook of Plan
      • Webhook of Task
      • Webhook of Call
      • Obtain the Detailed Information of Tasks
      • Obtain a Call Recording
      • Obtain Task Recordings
      • Obtain All Call Recordings of a Number in the Plan
      • Fetch robot list
      • Obtain call information and recording link by callid
  • 营销&电商
    • 快速上手
    • 调用任务相关的API
      • 创建拨打任务
      • 列出已创建的任务
      • 停止一个呼叫任务
      • 取消某个任务电话拨打
      • 获取任务详细信息
      • 任务结束状态通知
      • 任务电话维度拨打结束状态通知
      • 获取单个案件通话录音
      • 获取任务录音文件
      • 获取机器人列表
      • 根据callid获取电话信息和录音链接
    • 调用计划相关的API
      • 获取策略列表
      • 创建策略计划拨打任务
      • 获取计划状态信息
      • 获取计划内任务轮次信息
      • 列出已创建的任务
      • 取消一个呼叫任务
      • 取消计划中的某个电话的拨打
      • 计划结束状态通知
      • 任务结束状态通知
      • 任务电话维度拨打结束状态通知
      • 获取任务详细信息
      • 获取单个案件通话录音
      • 获取任务录音文件
      • 获取计划内某个电话所有的通话录音
      • 获取机器人列表
      • 根据callid获取电话信息和录音链接
  • Telemarketing & E-commerce
    • Quick Start
    • APIs Related to Calling Tasks
      • Create a Calling Task
      • List the Task Created
      • Cancel a Calling Task
      • Cancel a Certain Call in a Specific Task
      • Webhook of task
      • Webhook of Call
      • Obtain the Detailed Information of Tasks
      • Obtain a Call Recording
      • Obtain Task Recordings
      • Fetch robot list
      • Obtain call information and recording link by callid
    • APIs Related to Calling Plans
      • Obtain the List of Strategies
      • Create a Dialing Plan with Strategy
      • Obtain the Information of Plan Status
      • Obtain the Information of Each Round of the Plan
      • List the Task Created
      • Cancel a Calling Task
      • Cancel a Certain Call in a Plan
      • Webhook of Plan
      • Webhook of Task
      • Webhook of Call
      • Obtain the Detailed Information of Tasks
      • Obtain a Call Recording
      • Obtain Call Recordings
      • Obtain All Call Records of a Number in the Plan
      • Fetch robot list
      • Obtain call information and recording link by callid
  • 信审
    • 快速上手
    • 调用任务相关的API
      • 创建拨打任务
      • 列出已创建的任务
      • 停止一个任务拨打
      • 取消某个任务电话拨打
      • 任务结束状态通知
      • 任务电话维度拨打结束状态通知
      • 获取任务详细信息
      • 获取单个案件通话录音
      • 获取任务录音文件
      • 获取机器人列表
      • 根据callid获取电话信息和录音链接
    • 调用计划相关的API
      • 获取策略列表
      • 创建策略计划拨打任务
      • 获取计划状态信息
      • 获取计划内任务轮次信息
      • 列出已创建的任务
      • 停止一个任务拨打
      • 取消计划中的某个电话的拨打
      • 计划结束状态通知
      • 任务结束状态通知
      • 任务电话维度拨打结束状态通知
      • 获取任务详细信息
      • 获取单个案件通话录音
      • 获取任务录音文件
      • 获取计划内某个电话所有的通话录音
      • 获取机器人列表
      • 根据callid获取电话信息和录音链接
  • Info Check
    • Quick Start
    • APIs Related to Calling Tasks
      • Create a Calling Task
      • List the Task Created
      • Cancel a Calling Task
      • Cancel a Certain Call in a Specific Task
      • Webhook of task
      • Webhook of Call
      • Obtain the Detailed Information of Tasks
      • Obtain the Detailed Information of Tasks
      • Obtain a Call Recording
      • Obtain Task Recordings
      • Fetch robot list
      • Obtain call information and recording link by callid
    • APIs Related to Calling Plans
      • Obtain the List of Strategies
      • Create a Dialing Plan with Strategy
      • Obtain the Information of Plan Status
      • Obtain the Information of Each Round of the Plan
      • List the Task Created
      • Cancel a Calling Task
      • Cancel a Certain Call in a Plan
      • Webhook of Plan
      • Webhook of Task
      • Webhook of Call
      • Obtain the Detailed Information of Tasks
      • Obtain the Detailed Information of Tasks
      • Obtain a Call Recording
      • Obtain Call Recordings
      • Obtain All Call Records of a Number in the Plan
      • Fetch robot list
      • Obtain call information and recording link by callid
  • Workflow 工作流
    • 预测式外呼信息回调
      • PDS 任务状态更改回调
      • PDS 联系人状态更改回调
      • PDS 坐席状态更改回调
    • 创建一个新的Workflow任务
    • 获取workflow模板列表
    • 为workflow任务新增名单
    • 更新workflow任务内的名单信息
    • 取消workflow任务内某个电话的后续流程
    • Workflow外呼电话拨打结束通知 (催收/营销/电商示例)
    • Workflow外呼电话拨打结束通知 (信审示例)
    • 自定义API 节点数据推送
    • 验证 自定义API 节点数据推送
    • 停止workflow任务
    • 获取workflow任务列表
    • 获取workflow实例的子任务列表信息
    • 获取workflow节点运行的外呼任务
    • 获取workflow外呼任务明细 (催收/营销/电商示例)
    • 获取workflow外呼任务明细(信审示例)
    • 根据callee/caseid和taskid/workflow_id获取电话信息和录音链接
    • 根据callid获取电话信息和录音链接
    • 获取workflow里单个电话的所有录音
    • 通过 case_id/callee 查询 workflow_id
    • workflow 名单结束通知
    • workflow 状态变更通知
    • 获取workflow节点运行的WABA任务
    • 获取workflow内WABA任务明细
    • Workflow内WABA Template消息状态变更通知
    • Workflow内Chatbot会话结束通知
    • 获取Workflow内SMS message记录
    • Workflow内SMS message状态变更通知
  • Workflow
    • Webhooks of the Info of Predictive Dialer System
      • Webhook of Predictive Dialer Task Status Changes
      • Webhook of Predictive Dialer Contacts Status Changes
      • Webhook of Predictive Dialer Agents Status Changes
    • Create a New WorkFlow Task
    • Obtain the List of Workflow Templates
    • Add lists to an workflow task
    • Update the List Info of Workflow Task
    • Cancel the processes for a specific list
    • Notification of Call Completion in Workflow(Collection/Telemarketing/E-commerce)
    • Notification of Call Completion in Workflow(Info Check)
    • Custom API Node Data Push
    • Verify the Custom API Node Data Push
    • Stop the Workflow Task
    • Obtain the Workflow Task List
    • Obtain the Subtask List of the Workflow
    • Obtain the Outbound Task List of Workflow
    • Obtain the Outbound Task Details of Workflow(Collection/Telemarketing/E-commerce)
    • Obtain the Outbound Task Details of Workflow(Info Check)
    • Obtain Call Information and Recording Links by callee/caseid and taskid/workflow_id
    • Obtian Call Information and Recording Link by Call ID
    • Obtain All the Recordings of a Single Number in the Workflow
    • Query workflow_id using case_id/callee
    • Notification for Workflow List Completion
    • Notification of Workflow Status Change
    • Obtain the WABA Tasks List of Workflow
    • Obtain the WABA Task Details of Workflow
    • Notification of WABA Message Status Alteration in Workflow
    • Chatbot Session End Notification in Workflow
    • Obtain SMS message records within the workflow
    • Notification of SMS message status change within the workflow.
  • 传输过程中加解密
    • API接口使用AES加解密对接
    • API接口使用AES加解密对接-示例
  • Encryption and decryption during the transmission process
    • API Integration with AES Encryption/Decryption
    • API Interface with AES Encryption/Decryption - Example
  • Chatbot
    • 接入
      • 基础说明
        • 接入准备
        • 错误码
      • Bot接入
        • 用户发送消息
        • 关闭对话
      • 自定义人工接管
        • 接管流程
          • 转人工结果
        • 坐席会话与消息
          • 查询会话列表
          • 查询消息列表
          • 发送普通消息
          • 结束会话
          • 将用户消息标记为已读
          • 重开会话
      • Broadcast
        • 查询可用WABA账号
        • 查询模版列表
        • 查询模版详情
        • 发送模版消息
        • 发送单个模版消息接口
        • 查询模版消息发送结果
      • 会话管理
        • 结束会话
    • 定制
      • HSB
        • HSB关于custom字段使用说明
      • 华为
        • api
          • 用户发送消息
          • 转人工结果
        • webhook
          • 回调转人工申请
          • 结束会话
      • Mandiri
        • 3dolphin
          • create token
          • outgoing msg
          • close session
      • AICC
        • 获取公司信息
        • 获取公司名下的渠道绑定关系列表
        • 回调会话结束事件
        • 查询公司所有渠道信息
      • CTOS-CM
        • 用户信息上报
      • Omnichannel-待开发
        • 查询可用WABA账号
        • 创建Template
        • 删除Template
        • 查询模版列表
        • 查询模版详情
        • 发送模版消息
        • 发送普通消息
        • 回调消息状态变更
        • 回调用户消息
      • JT
        • 查询运单号物流轨迹
    • 回调
      • Bot回调
        • 回调机器人回复消息
        • 回调转人工申请
        • 回调会话总结
        • 回调结束会话
      • 会话/消息事件回调
        • 回调转人工结果
        • 回调发起转人工通知
        • 会话结束后上报
        • 用户发送的消息事件上报
        • 渠道发送的消息事件上报
        • 渠道发送的消息状态变更事件上报
        • 回调渠道模板消息发送后状态变更
      • WA/WABA回调
        • 回调WABA状态变更
        • 回调phone number质量变更
        • 回调phone number name变更
      • Template回调
        • 回调模版消息状态及计费
        • 回调Template质量变更
        • 回调Template状态变更
    • 文件和媒体
      • 上传文件
      • 上传文件(谷歌地图缩略图)
  • Chatbot English
    • Integration
      • Basic Guide
        • Quick Start
        • Error Code
      • Bot Integration
        • User send message
        • Close session
      • Custom Human Handoff
        • Handoff Flow
          • Agent transfer result
        • Agent Conversation & Messages
          • Query conversation list
          • Query message list
          • Send regular message
          • Mark user message as read
          • End session
      • Broadcast
        • Query available WABA accounts
        • Query template list
        • Query Template details
        • Send template message
        • Send single template message
        • Query the template message sending result
      • Session Management
        • Terminate session
    • Customization
      • AICC
        • Callback for session end event
      • CTOS-CM
        • Upload User Info
      • Omnichannel - To Be Developed
        • Query available WABA accounts
        • Create Template
        • Delete Template
        • Query Template List
        • Query Template Details
        • Send Template Message
        • Send Message
        • Callback message status change
        • Callback user message
      • JT-BR
        • Callback template message sending result
    • Webhooks
      • Bot webhooks
        • Callback bot reply message
        • Callback transfer to agent request
        • Callback for ended session
        • Call for session summary
      • conversation/message event webhooks
        • Report after session ends
        • Transfer Started Webhook
        • Transfer Result Webhook
        • Callback status change after the message is sent
      • WA/WABA webhooks
        • Callback for WABA Status Change
        • Callback phone number quality change
        • Callback phone number name change
      • Template webhooks
        • Callback WABA Template Message Status & Billing
        • Callback Template Quality Change
        • Callback Template Status Change
      • HSB
        • Callback single template message user response
      • Custom agent
        • Callback for status change after the agent message is sent
        • Callback for messages sent by the user after transferring to agent
    • Files & Media
      • Upload file
      • Upload file (Google maps thumbnail)
  • 呼入机器人业务
    • inbound业务对接介绍
    • 验证并获取令牌
    • 根据callid获取通话信息和录音链接
    • 转人工成功后通知 v2
    • 电话结束后通知 v2
    • 查询统计数据
    • 转人工成功后通知
    • 电话结束后通知
  • Inbound
    • Inbound Business Integration Guide
    • Token Authentication and Obtain
    • Obtain Call Information and Recording Link by Callid
    • Notification after Successful Transfer to an Agent v2
    • Notification after the Call Ends v2
    • Query Statistical Data
    • Notification after Successful Transfer to an Agent
    • Notification after the Call Ends
  • 数据模型
    • 英语
      • WABA message status
      • hang up by
      • transfer status
      • reason code
    • 中文
      • ring type
      • hang up type
      • task status
      • call status
      • plan status
      • Intention
      • question answer
    • http code
    • hang up type
    • WABA message status
    • ring type
    • hang up by
    • call status
    • transfer status
    • Intention
    • reason code
    • plan status
    • task status
    • TaskID
    • error code
    • question answer
    • strategy model
    • gender
    • date_format
    • ring type1
    • hang up type2
    • task status3
    • call status4
    • plan status5
    • Intention6
    • WABA message status7
    • sender type
    • hang up by8
    • transfer status9
    • reason code10
    • question answer11
    • question status
    • whether answer
    • question type
  1. 传输过程中加解密

API接口使用AES加解密对接-示例

Example1: GET请求和响应, 获取任务详情#

示例中使用python语言,实际语言可自行选择。
import requests
 
url = "http://localhost:8000/service/cloud/detail"
 
aeskey = "airudderredduria"  # 密钥
query_string = "TaskID=69f531a01a9df58aa6de2487be610abb" #原始数据
encrypt_data = aes_encrypt(query_string, aeskey).decode() # 对原始数据进行aes加密
encrypt_sign = sha256_sign(query_string) # 对原始数据进行sha256 ,生成签名  
print("encrypt_data:", encrypt_data) # 打印加密后的数据
print("encrypt_sign:", encrypt_sign) # 打印签名
# encrypt_data:  打印加密后的数据
qbj8cnqKnqR66qDS49ib9ymU1mpMCyp8Dm0gS1VvmnEqTxPGSBzruAU1sapP+cye
# query_sign:   加密后的签名 
6956d7af4c89b89f19f9ae0a8be4bcf12abe7c6ed893691733f3480ad3f3aabc
 
url = "{}?{}".format(url, encrypt_data)
 
headers = {
  'Authorization': 'Token sueT3jBg7l9jirwKRZkg4KbxsmIs2hiPQbKLrrNSg8q2UphI4CS3jaV7j34tEt8s',
  'Is-Encrypted': '1',  # 标记加密
  'Signed':  '6956d7af4c89b89f19f9ae0a8be4bcf12abe7c6ed893691733f3480ad3f3aabc' # 签名放在header中
}
 
response = requests.request("GET", url, headers=headers)
print(response.content)

Example2: POST请求和响应, 创建任务#

import requests
 
url = "http://localhost:8000/service/cloud/task"
 

# 原始数据
body = """{
    "TaskName": "test_detail_robot_id",
    "ScheduleStartTime": "2020-09-15 11:14:37",
    "ScheduleEndTime": "2020-09-15 11:18:37",
    "RobotID": "Promotion_ID_Jessica_Adakami",
    "SIPLine": "FS_Line",
    "RepeatInterval": 10,
    "RepeatNumber": 3,
    "Details": [
        {
            "Debtor": "y",
            "Mobile": "+8612345678",
            "LoanDate": "2019-06-01",
            "DueDate": "2019-06-10",
            "Arrears": 100,
            "LoanAmount": 105,
            "Unit": "Dollar",
            "Platform": "adakami",
            "borrower_name": "borrower_name",
            "borrower_mobile": "borrower_mobile",
            "borrowed_date": "2019-01-01",
            "RobotID": "Promotion_ABC_test2"
        }
    ],
    "Type": "normal"
}"""

aeskey = "airudderredduria" # 密钥
encrypt_data = aes_encrypt(body, aeskey).decode() # 对body进行Aes加密
encrypt_sign = sha256_sign(body) # 对body进行sha256 加密,生成签名

print("encrypt_data:", encrypt_data) 
print("encrypt_sign:", encrypt_sign)
#encrypt_data: 加密后的body 
cvaecnwEIYUodB/sEgkOXd/J3aMWh+TzdzoFhl3Fkua84Ks3RUA98IWqAIwQNYBDiOY50O+CHBSQvD32HpNk+jTtHhZlAZTAPKTmgECS1n3eXKf0P5OvPsNgRrC+KgNsboCnNQaTt8L4T/Nm975bAwilXrU+K/Jump6CLoOVYorMvJjMVUcHryz7NDo7ShGQ1sQVOWHenTI5Vd1gJ4AT+QoNjO/a6EV4qMT8LAyWJoX8LQHDzy9LjZaQEpoID/jVu8UI+ew6elo68iBCYG560lQg8TWlz0w9IuGsHCwN+E8U56vTT394IRCRkeCz1Q8AILbqxHq72/kEHHqQ9pjfNqLXX3RWnTI12r1sxqX0ylTx6L60d13WOp4JvhzvRB1P58/lOQ27pkx1TkQOfx+PeMC36htnZnKMmkiI+I2Z/jxADekOY1n9FkbCj+3IKibVpy+hJQPDQs5jW6ze1UlgVAswONjXdwWZrNSHRJdm2ck/GA8hpVgx98FkTRZG4jA3t31vKx36N6JxEh/zTrEONS5J/hF8FuTT6Pew5tBpgVJy/ZlzHrqY56FV0IqvkdZBU7qZQiIcqTIMYksLaa5L0FOjrjZBDw7Y/RvccxZ/Od4N0X7RUZrZ6mMBGIdkwGTYy0um/judYK8f2KSB8FePXhYe+TfpcqziqPnXRCKKv/L/YIrOZqkOOVNHiu7GFfP2Nb2L+osx3VQ6MbPbY4kpb/KBz22bWxt5ZCoTsB2j6arK69uxQ3bEI5bj00BcaJ7r9Udn3LCxDzixJ8vJveVeQjmwAR3JEDgkmLtPl8wsLSFCjlxGGWnnCUrLgCGHyIPcD1tZGfyPiX5cSE+iXU0qk66ubTYTRrCcAjHLS6ur/l1QuYo9bpaSNWYoqagyea/j15mZjtNMoxp0cWLWaKIENXAvDz2+qWlJc9hWcSUBUU+BwSU09QIBJhqZ/fYyOIoyZmVIY5ViKefvIYFnTk72owz3Zy07ATAU/tnp3MD+qODNLUKrqepQcRtu1vxIApLGszw+89zASlueyngen95ShA==
#encrypt_sign:  加密后的签名# 
b240a632ccda6d0df1a75d79e91229848c26cfdc7eb5d60899aee22445450035
 
headers = {
  'Authorization': 'Token sueT3jBg7l9jirwKRZkg4KbxsmIs2hiPQbKLrrNSg8q2UphI4CS3jaV7j34tEt8s',
  'Is-Encrypted': '1', # 标记加密
  'Signed':  'b240a632ccda6d0df1a75d79e91229848c26cfdc7eb5d60899aee22445450035' # 将签名放入header中
}
 
response = requests.request("POST", url, headers=headers, data=encrypt_data) # data传入aes加密后的body
 
content = response.content
decrypt_data = aes_decrypt(content, aeskey)
decrypt_sign = sha256_sign(decrypt_data)
signed = response.headers.get('Signed', '')
print("decrypt_data:", decrypt_data)
print("decrypt_sign:", decrypt_sign)
print("signed      :", signed)

#decrypt_data: b'{"data": {}, "status": "Task name already exists for 69f531a01a9df58aa6de2487be610abb", "code": 10403}'
#decrypt_sign: 1e403b939a15857a2a670cf44daa5de6133921b701d76c01d1c108c6622010de
#signed      : 1e403b939a15857a2a670cf44daa5de6133921b701d76c01d1c108c6622010de
if decrypt_sign == signed:
    pass
    # 后续处理
 
修改于 2022-11-14 11:13:28
上一页
API接口使用AES加解密对接
下一页
API Integration with AES Encryption/Decryption
Built with