Account
アカウントのAPIリファレンスは以下の通りです。

Create

アカウントの作成
Role actions
  • ModifyAccount
Request
1
POST /accts HTTP1.1
2
Authorization: Bearer {token}
3
Content-Type: application/json
4
5
{request body}
Copied!
以下に{request body}のリクエストペイロードの例を示します。
{request body}
1
{
2
"vendor":"aws",
3
"customer_id":"012345678912",
4
"account_id":"919999618919"
5
"company_id":"AJfdivbDjhvbpE",
6
"name":"ripple customer1",
7
"note":null
8
}
Copied!
{request body} description
Field
Type
Required
Validation
Description
customer_id
string
Yes
- AWS 12桁 - Azure 16~36桁
- AWS AccountID - Azure SubscriptionID
account_id
string
Yes
- AWS 12桁 - AZURE 7桁
- AWS PayerAccountID - Azure BillingID
company_id
string
Yes
-
請求グループ内部ID
vendor
string
Yes
- サポート: aws,azure
name
string
Yes
- 長さ: 3 ~ 100
登録する顧客名
note
string
No
-
備考欄
Response
1
HTTP 200
2
3
{"status":"success"}
4
5
HTTP 400 customer id が既に登録されている場合
6
7
{
8
"code":"5005",
9
"message":"account function exception",
10
"description":"Customer id already exists."
11
}
Copied!
Pythonでのサンプル
1
import requests
2
import json
3
4
def get_token():
5
# Note: you can see details https://docs.alphaus.cloud/v/api-reference/authentication
6
# Assign generated values for client_id and client_secret
7
params={
8
"grant_type": "client_credentials",
9
"client_id": "{client_id}",
10
"client_secret": "{client_secret}",
11
"scope": "openid",
12
}
13
try:
14
response = requests.post(
15
url="https://login.alphaus.cloud/ripple/access_token",
16
headers={
17
},
18
params=params,
19
files=params,
20
)
21
except requests.exceptions.RequestException:
22
print('HTTP Request failed')
23
24
r = response.json()
25
return r['access_token'], r["token_type"]
26
27
def send_request(type, token):
28
# Authorization header
29
auth = type + " " + token
30
try:
31
response = requests.post(
32
url="https://api.alphaus.cloud/m/ripple/accts",
33
headers={
34
"Content-Type": "application/json;",
35
"Authorization": auth
36
},
37
data=json.dumps({
38
"account_id": "{account_id}",
39
"vendor": "{vendor}",
40
"customer_id": "{customer_id}",
41
"note": None,
42
"company_id": "{company_id}",
43
"name": "customer_name"
44
})
45
)
46
print('Response HTTP Status Code: {status_code}'.format(
47
status_code=response.status_code))
48
print('Response HTTP Response Body: {content}'.format(
49
content=response.content))
50
except requests.exceptions.RequestException:
51
print('HTTP Request failed')
52
53
access_token, token_type = get_token()
54
send_request(token_type, access_token)
Copied!

List

アカウントリストの取得
Role actions
  • ReadAccount
  • ModifyAccount
Request
1
GET /accts?vendor={vendor} HTTP1.1
2
Authorization: Bearer {token}
Copied!
以下に{vendor}のパラメータの例を示します。
{vendor}
  • aws
  • azure
Response
1
HTTP 200
2
3
[
4
{
5
"billinggroup_id":"Billing1",
6
"billinggroup_name":"Billing1",
7
"company_id":"AJfdivbDjhvbpE",
8
"customer_id":"012345678912",
9
"customer_name":"ripple customer1",
10
"account_id":"919999618919",
11
"vendor":"aws",
12
"note":null,
13
"payer":false,
14
"service_discount":null,
15
"project_id":null,
16
"azure_customer_id":null
17
},
18
...
19
]
Copied!

Update

アカウントの更新
Role actions
  • ModifyAccount
Request
1
PUT /accts/{customer_id}/edit HTTP1.1
2
Authorization: Bearer {token}
3
Content-Type: application/json
4
5
{request body}
Copied!
以下に{customer_id}のパラメータの例を示します。
{customer_id}
AWS AccountID or Azure SubscriptionID
以下に{request body}のリクエストペイロードの例を示します。
{request body}
1
{
2
"vendor":"aws",
3
"account_id":"919999618919"
4
"company_id":"AJfdivbDjhvbpE",
5
"name":"ripple customer1",
6
"note":null
7
}
Copied!
{request body} description
Field
Type
Required
Validation
Description
account_id
string
Yes
- AWS 12桁 - AZURE 7桁
- AWS PayerAccountID - Azure BillingID
company_id
string
Yes
-
請求グループ内部ID
vendor
string
Yes
- サポート: aws,azure
name
string
Yes
- 長さ: 3 ~ 100
登録する顧客名
note
string
No
-
備考欄
Response
1
HTTP 200
2
3
{"status":"success"}
4
5
HTTP 400 customer id が登録されていない場合
6
7
{
8
"code":"5005",
9
"message":"account function exception",
10
"description":"Customer id is not exists."
11
}
Copied!

Delete

アカウントの削除
Role actions
  • ModifyAccount
Request
1
DELETE /accts/{vendor}/{id} HTTP1.1
2
Authorization: Bearer {token}
Copied!
以下に{vendor}のパラメータの例を示します。
{vendor}
  • aws
  • azure
以下に{id}フォーマットのパラメータの例を示します。
{id}
{customer_id}|{account_id}。 エンドポイント例: /accts/aws/012345678912|919999618919
Response
1
HTTP 200
2
3
{"status":"success"}
4
5
HTTP 400 customer id が登録されていない場合
6
7
{
8
"code":"5005",
9
"message":"account function exception",
10
"description":"Customer id is not exists."
11
}
Copied!
Copy link