Under the hood, we are returning the result of a composed fetch.
All service methods accept a ServiceMethodOptions object to pass query parameters, a payload, and headers.
All service methods support a tail argument to pass options to the SDK, including the composed fetch call.
Service Method Names
Basic CRUD operations provided by services are exposed as the following:
Service Method Name
HTTP Method
Description
Example
get
GET
Fetch a single resource.
transfer.endpoint.get()
getAll
GET
Fetch a list of resources.
flows.flows.getAll()
create
POST
Create a new resource.
gcs.roles.create()
update
PUT
Update an existing resource.
gcs.endpoint.update()
patch
PATCH
Update an existing resource.
gcs.endpoint.patch()
remove
DELETE
Delete an existing resource.
gcs.collections.remove()
Methods that do not map to obvious CRUD operations are named according to the resource. i.e., groups.groups.getMyGroups(), transfer.endpointSearch(), search.query.post()
Example: Using the SDK to search for endpoints via Transfer API.
While all methods support passing of headers and direct modification of the underlying fetch call, the SDK provides an AuthorizationManager that can be used to manage access tokens and handle the authorization process.
Example: Using the AuthorizationManager with a service method.
Description
@globus/sdkprovides modules for interacting with the various APIs that make up the Globus platform.Key Concepts
Promisethat resolves to a Fetch API Response object.fetch.ServiceMethodOptionsobject to pass query parameters, a payload, and headers.fetchcall.Service Method Names
Basic CRUD operations provided by services are exposed as the following:
getGETtransfer.endpoint.get()getAllGETflows.flows.getAll()createPOSTgcs.roles.create()updatePUTgcs.endpoint.update()patchPATCHgcs.endpoint.patch()removeDELETEgcs.collections.remove()Methods that do not map to obvious CRUD operations are named according to the resource. i.e.,
groups.groups.getMyGroups(),transfer.endpointSearch(),search.query.post()Example: Using the SDK to search for endpoints via Transfer API.
Example: Using the SDK to fetch a single flow from the Flows API.
Authorization
While all methods support passing of
headersand direct modification of the underlyingfetchcall, the SDK provides anAuthorizationManagerthat can be used to manage access tokens and handle the authorization process.Example: Using the AuthorizationManager with a service method.