MCPcopy
hub / github.com/larksuite/cli / DoAPI

Method DoAPI

internal/client/client.go:316–319  ·  view source on GitHub ↗

DoAPI executes a raw Lark SDK request and returns the raw *larkcore.ApiResp. Unlike CallAPI which always JSON-decodes, DoAPI returns the raw response — suitable for file downloads (pass larkcore.WithFileDownload() via request.ExtraOpts) and any endpoint whose Content-Type may not be JSON.

(ctx context.Context, request RawApiRequest)

Source from the content-addressed store, hash-verified

314// for file downloads (pass larkcore.WithFileDownload() via request.ExtraOpts) and
315// any endpoint whose Content-Type may not be JSON.
316func (c *APIClient) DoAPI(ctx context.Context, request RawApiRequest) (*larkcore.ApiResp, error) {
317 apiReq, extraOpts := c.buildApiReq(request)
318 return c.DoSDKRequest(ctx, apiReq, request.As, extraOpts...)
319}
320
321// CallAPI is a convenience wrapper: DoAPI + ParseJSONResponse. Use DoAPI
322// directly when the response may not be JSON (e.g. file downloads).

Callers 4

CallAPIMethod · 0.95
serviceMethodRunFunction · 0.45
apiRunFunction · 0.45
CallAPIMethod · 0.45

Calls 2

buildApiReqMethod · 0.95
DoSDKRequestMethod · 0.95

Tested by

no test coverage detected