feat: Get API(api-record-get-multi)でレコードを取得するgetRecordsDataを追加
This commit is contained in:
parent
adfd140d9b
commit
d3d844d441
@ -291,6 +291,38 @@ Function BuildViewFromSheet() As Object
|
||||
Set BuildViewFromSheet = viewObj
|
||||
End Function
|
||||
|
||||
'******************************************************************************
|
||||
'Get方式(api-record-get-multi)でレコードを取得する
|
||||
'成功時、レコードDictionaryのCollection(Response.Data)を返す
|
||||
Function getRecordsData(tableId As String) As Collection
|
||||
Dim apiUrl As String
|
||||
Dim apiUrlParam As String
|
||||
|
||||
apiUrl = baseURL & "/pleasanter/api/items/" & tableId & "/"
|
||||
apiUrlParam = "get"
|
||||
|
||||
Dim apiHeaders As New Dictionary
|
||||
apiHeaders.Add "Content-Type", "application/json;charset=utf-8"
|
||||
|
||||
Dim apiBody As New Dictionary
|
||||
apiBody.Add "ApiVersion", "1.1"
|
||||
apiBody.Add "ApiKey", apiKey
|
||||
|
||||
Dim viewObj As Object
|
||||
Set viewObj = BuildViewFromSheet()
|
||||
If Not viewObj Is Nothing Then
|
||||
apiBody.Add "View", viewObj
|
||||
End If
|
||||
|
||||
Dim res As Object
|
||||
Set res = callRestApi("POST", apiUrl, apiUrlParam, apiHeaders, apiBody)
|
||||
|
||||
If res("StatusCode") = 200 Then
|
||||
Debug.Print "レコードの取得に成功しました"
|
||||
Set getRecordsData = res("Response")("Data")
|
||||
End If
|
||||
End Function
|
||||
|
||||
'******************************************************************************
|
||||
'REST API呼出処理
|
||||
' method GetかPOSTか
|
||||
|
||||
Loading…
Reference in New Issue
Block a user