# Class SASjsApiClient

### Hierarchy

- SASjsApiClient

### Constructors

- constructor

### Methods

- deploy
- executeJob
- getAccessToken
- getAuthCode
- refreshTokens
- setConfig

## Constructors

### constructor

- new SASjsApiClient(serverUrl: string, requestClient: RequestClient): SASjsApiClient

- - Defined in src/SASjsApiClient.ts:7

  #### Parameters

  - ##### serverUrl: string

  - ##### requestClient: RequestClient

  #### Returns SASjsApiClient

## Methods

### deploy

- deploy(members: [FolderMember, ServiceMember], appLoc: string): Promise<object>

- - Defined in src/SASjsApiClient.ts:17

  #### Parameters

  - ##### members: [FolderMember, ServiceMember]

  - ##### appLoc: string

  #### Returns Promise<object>

### executeJob

- executeJob(query: ExecutionQuery): Promise<object>

- - Defined in src/SASjsApiClient.ts:31

  #### Parameters

  - ##### query: ExecutionQuery

  #### Returns Promise<object>

### getAccessToken

- getAccessToken(clientId: string, authCode: string): Promise<SASjsAuthResponse>

- - Defined in src/SASjsApiClient.ts:48

  Exchanges the auth code for an access token for the given client.

  #### Parameters

  - ##### clientId: string

    the client ID to authenticate with.

  - ##### authCode: string

    the auth code received from the server.

  #### Returns Promise<SASjsAuthResponse>

### getAuthCode

- getAuthCode(username: string, password: string, clientId: string): Promise<string>

- - Defined in src/SASjsApiClient.ts:69

  Performs a login authenticate and returns an auth code for the given client.

  #### Parameters

  - ##### username: string

    a string representing the username.

  - ##### password: string

    a string representing the password.

  - ##### clientId: string

    the client ID to authenticate with.

  #### Returns Promise<string>

### refreshTokens

- refreshTokens(refreshToken: string): Promise<SASjsAuthResponse>

- - Defined in src/SASjsApiClient.ts:59

  Exchanges the refresh token for an access token.

  #### Parameters

  - ##### refreshToken: string

    the refresh token received from the server.

  #### Returns Promise<SASjsAuthResponse>

### setConfig

- setConfig(serverUrl: string): void

- - Defined in src/SASjsApiClient.ts:13

  #### Parameters

  - ##### serverUrl: string

  #### Returns void

Generated using TypeDoc