Pythonでグループにフィールドを追加します
Pythonを使用して列を汚染グループに追加します
Python : APIドキュメント
Pythonでグループにフィールドを追加します
import urllib2
afilnet_class="group"
afilnet_method="addcolumntogroup"
afilnet_user="user"
afilnet_password="password"
afilnet_idgroup="1000"
afilnet_field="name"
# Create an URL request
sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&field="+afilnet_field
result = urllib2.urlopen(sUrl).read()
from urllib.request import urlopen
from urllib.parse import urlencode
afilnet_class="group"
afilnet_method="addcolumntogroup"
afilnet_user="user"
afilnet_password="password"
afilnet_idgroup="1000"
afilnet_field="name"
# Create an URL request
sUrl = "https://www.afilnet.com/api/http/"
data = urlencode({"class": afilnet_class,"method": afilnet_method,"user": afilnet_user,"password": afilnet_password,"idgroup": afilnet_idgroup,"field": afilnet_field}).encode("utf-8")
result = urlopen(sUrl, data).read()
print(result)
import requests
afilnet_class="group"
afilnet_method="addcolumntogroup"
afilnet_user="user"
afilnet_password="password"
afilnet_idgroup="1000"
afilnet_field="name"
# Create an URL request
sUrl = "https://www.afilnet.com/api/basic/?class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&field="+afilnet_field
result = requests.get(sUrl,auth=requests.auth.HTTPBasicAuth(afilnet_user,afilnet_password))
print(result.text)
パラメータ | 説明 | 必須/オプション |
---|---|---|
class=group | 要求されたクラス:要求が行われるクラス | 強制的 |
method=addcolumntogroup | 要求されたクラスメソッド:要求が行われるクラスのメソッド | 強制的 |
user | Afilnetアカウントのユーザーと電子メール | 強制的 |
password | Afilnetアカウントのパスワード | 強制的 |
idgroup | グループID | 強制的 |
field | グループフィールド | 強制的 |
リクエストを行うと、次のフィールドが表示されます。
- status
-
結果(ステータス=成功の場合)、ここで次の値を受け取ります。
- 追加の値は送信されません
- エラー(ステータス=エラーの場合)、ここでエラーコードを受け取ります
考えられるエラーコードは以下のとおりです。
コード | 説明 |
---|---|
MISSING_USER | ユーザーまたはメールは含まれていません |
MISSING_PASSWORD | パスワードは含まれていません |
MISSING_CLASS | 含まれていないクラス |
MISSING_METHOD | 含まれていないメソッド |
MISSING_COMPULSORY_PARAM | 必須パラメーターは含まれていません |
INCORRECT_USER_PASSWORD | 間違ったユーザーまたはパスワード |
INCORRECT_CLASS | 間違ったクラス |
INCORRECT_METHOD | 間違った方法 |
NOT_ACCESS_TO_GROUP | 指定されたグループへの参加は許可されていません |
パラメーター:
- class : group
- method : addcolumntogroup
- user : user
- password : password
- idgroup : 1000
- field : name
要求:
https://www.afilnet.com/api/http/?class=group&method=addcolumntogroup&user=user&password=password&idgroup=1000&field=name