通过WhatsAPP使用Oracle发送文件
whatsapp.sendfile.desc.language
Oracle : API文档
通过WhatsAPP使用Oracle发送文件
declare
l_url varchar2(200) := 'http://www.afilnet.com/api/http/?class=whatsapp'||'&'||'method=sendfile'||'&'||'user=user'||'&'||'password=password'||'&'||'platformid=100'||'&'||'destination=3460000000'||'&'||'type=image'||'&'||'fileurl=https://www.example.com/image.jpg'||'&'||'thumburl=https://www.example.com/thumb.jpg'||'&'||'message=test+message';
l_req utl_http.req;
l_resp utl_http.resp;
l_text varchar2(32767);
begin
l_req := utl_http.begin_request(l_url);
l_resp := utl_http.get_response(l_req);
begin
loop
utl_http.read_text(l_resp, l_text, 32766);
dbms_output.put_line(l_text);
end loop;
exception
when utl_http.end_of_body then
utl_http.end_response(l_resp);
end;
end;
参数 | 描述 | 必修/可选 |
---|---|---|
class=whatsapp | 要求的课程:要求的课程 | 必修 |
method=sendfile | 请求的类方法:发出请求的类的方法 | 必修 |
user | 您的Afilnet帐户的用户和电子邮件 | 必修 |
password | 您的Afilnet帐户的密码 | 必修 |
platformid | 平台识别码 | 必修 |
destination | whatsapp.sendfile_destination | 必修 |
type | whatsapp.sendfile_type | 必修 |
fileurl | whatsapp.sendfile_fileurl | 必修 |
thumburl | whatsapp.sendfile_thumburl | 可选的 |
message | whatsapp.sendfile_message | 可选的 |
发出请求时,您将收到以下字段:
- status
-
结果(如果status = success),您将在此处收到以下值:
- 没有其他值会发送给您
- 错误(如果status = error),在这里您将收到错误代码
下面列出了可能的错误代码
码 | 描述 |
---|---|
MISSING_USER | 不包括用户或电子邮件 |
MISSING_PASSWORD | 不包含密码 |
MISSING_CLASS | 不包括课程 |
MISSING_METHOD | 不包括方法 |
MISSING_COMPULSORY_PARAM | 不包括强制参数 |
INCORRECT_USER_PASSWORD | 用户或密码错误 |
INCORRECT_CLASS | 班级不正确 |
INCORRECT_METHOD | 方法不正确 |
CHANNEL_NOT_FOUND | 指定的频道不存在 |
CHAT_NOT_FOUND | 指示的聊天不存在 |
INCORRECT_FILETYPE | 文件类型错误,请检查可能的值 |
INCORRECT_FILEURL | 档案网址无效 |
INCORRECT_THUMBURL | 缩略图的网址无效 |
参数:
- class : whatsapp
- method : sendfile
- user : user
- password : password
- platformid : 100
- destination : 3460000000
- type : image
- fileurl : https://www.example.com/image.jpg
- thumburl : https://www.example.com/thumb.jpg
- message : test+message
请求:
https://www.afilnet.com/api/http/?class=whatsapp&method=sendfile&user=user&password=password&platformid=100&destination=3460000000&type=image&fileurl=https://www.example.com/image.jpg&thumburl=https://www.example.com/thumb.jpg&message=test+message