# API Basics
source: https://developer.mastercard.com/mdes-token-connect/documentation/api-basics/index.md

## API Security {#api-security}

### Client Authentication {#client-authentication}

Mastercard uses OAuth 1.0a for authenticating your application. You can manage your authentication keys from your [Developer Dashboard](https://developer.mastercard.com/dashboard) after you created a project using MDES Token Connect.

### Transport and Payload Encryption {#transport-and-payload-encryption}

The transport between client applications and Mastercard is secured using [TLS/SSL](https://en.wikipedia.org/wiki/Transport_Layer_Security), which means data are encrypted by default when transmitted across networks.

In addition to that, MDES Token Connect uses [Mastercard field-level payload encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/#mastercard-encryption) to secure sensitive data like Personally Identifying Information (PII) and Payment Card Information (PCI)
You can manage your encryption keys from your [Developer Dashboard](https://developer.mastercard.com/dashboard).
Tip: Do you want to learn more about the authentication and encryption schemes Mastercard uses? For that, read our [Using OAuth 1.0a to Access Mastercard APIs](https://developer.mastercard.com/platform/documentation/security-and-authentication/using-oauth-1a-to-access-mastercard-apis/) and [Securing Sensitive Data Using Payload Encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/) guides.

## How to Consume the MDES Token Connect API? {#how-to-consume-the-mdes-token-connect-api}

Note: There are multiple ways of integrating with MDES Token Connect:

1. Using a generated API client (recommended)
2. Using a method of your choice

### Generating your own MDES Token Connect API client {#generating-your-own-mdes-token-connect-api-client}

Create customizable API clients from the MDES Token Connect API specification and let Mastercard open-source client libraries handle the authentication and encryption for you. This approach offers the more flexibility and is strongly recommended.

For this, please follow our [Generating and Configuring a Mastercard API Client](https://developer.mastercard.com/platform/documentation/security-and-authentication/generating-and-configuring-a-mastercard-api-client/) tutorial with:

* The Token Connect [API specification](https://developer.mastercard.com/mdes-token-connect/documentation/api-reference/index.md)
* The encryption configuration below (to be used at the "*Enable Encryption*" step):

* Java
* C#

```java
FieldLevelEncryptionConfig fieldLevelEncryptionConfig = FieldLevelEncryptionConfigBuilder.aFieldLevelEncryptionConfig()
    .withEncryptionPath("$.pushFundingAccounts.encryptedPayload.encryptedData", "$.pushFundingAccounts.encryptedPayload")
    .withEncryptionCertificate(EncryptionUtils.loadEncryptionCertificate("path/to/token-connect-request-encryption-sandbox.crt"))
    .withOaepPaddingDigestAlgorithm("SHA-512")
    .withEncryptedValueFieldName("encryptedData")
    .withEncryptedKeyFieldName("encryptedKey")
    .withIvFieldName("iv")
    .withOaepPaddingDigestAlgorithmFieldName("oaepHashingAlgorithm")
    .withEncryptionCertificateFingerprintFieldName("publicKeyFingerprint")
    .withEncryptionCertificateFingerprint("4070BFE5119426F5F9E232CB86D372A4F9B2314C")
    .withFieldValueEncoding(FieldValueEncoding.HEX)
    .build();
```

```csharp
var fieldLevelEncryptionConfig = FieldLevelEncryptionConfigBuilder.AFieldLevelEncryptionConfig()
    .WithEncryptionPath("$.pushFundingAccounts.encryptedPayload.encryptedData", "$.pushFundingAccounts.encryptedPayload")
    .WithEncryptionCertificate(EncryptionUtils.LoadEncryptionCertificate("path/to/token-connect-request-encryption-sandbox.crt"))
    .WithOaepPaddingDigestAlgorithm("SHA-512")
    .WithEncryptedValueFieldName("encryptedData")
    .WithEncryptedKeyFieldName("encryptedKey")
    .WithIvFieldName("iv")
    .WithOaepPaddingDigestAlgorithmFieldName("oaepHashingAlgorithm")
    .WithEncryptionCertificateFingerprintFieldName("publicKeyFingerprint")
    .WithEncryptionCertificateFingerprint("4070BFE5119426F5F9E232CB86D372A4F9B2314C")
    .WithValueEncoding(FieldValueEncoding.Hex)
    .Build();
```

### Using a method of your choice {#using-a-method-of-your-choice}

MDES Token Connect exposes a REST API: you are free to use the REST/HTTP client of your choice and can still leverage the Mastercard open-source [client authentication](https://developer.mastercard.com/platform/documentation/security-and-authentication/using-oauth-1a-to-access-mastercard-apis/#client-libraries) and [client encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/#client-libraries) libraries for signing your requests and dealing with payload encryption.

For details, refer to the MDES Token Connect [API Reference](https://developer.mastercard.com/mdes-token-connect/documentation/api-reference/index.md).

## Environments and Domains {#environments-and-domains}

Use the environment that matches your lifecycle stage. Sandbox(MTF) is used for dynamic integration validation with MDES MTF environment, and Production is used for live traffic.

### Global {#global}

* Production
* Sandbox(MTF)

```Production
https://api.mastercard.com/mdes/connect/1/0/
```

```Sandbox(MTF)
https://sandbox.api.mastercard.com/mdes/mtf/connect/1/0/
```

#### Get Eligible Token Requestors {#get-eligible-token-requestors}

* Production
* Sandbox(MTF)

```Production
https://api.mastercard.com/mdes/connect/1/0/getEligibleTokenRequestors
```

```Sandbox(MTF)
https://sandbox.api.mastercard.com/mdes/mtf/connect/1/0/getEligibleTokenRequestors
```

#### Get Assets {#get-assets}

* Production
* Sandbox(MTF)

```Production
https://api.mastercard.com/mdes/issuer-assets/1/0/asset/tokenrequestor/{AssetId}
```

```Sandbox(MTF)
https://sandbox.api.mastercard.com/mdes/mtf/issuer-assets/1/0/asset/tokenrequestor/{AssetId}
```

#### Push Multiple Accounts {#push-multiple-accounts}

* Production
* Sandbox(MTF)

```Production
https://api.mastercard.com/mdes/connect/1/0/pushMultipleAccounts
```

```Sandbox(MTF)
https://sandbox.api.mastercard.com/mdes/mtf/connect/1/0/pushMultipleAccounts
```

### India Region {#india-region}

Note: There is no Sandbox environment for the India region; use the MTF environment for testing.

#### Get Eligible Token Requestors {#get-eligible-token-requestors-1}

* Production
* Sandbox(MTF)

```Production
https://digital.api.mastercard.co.in/mdes/connect/1/0/getEligibleTokenRequestors
```

```Sandbox(MTF)
https://digital.api.mastercard.co.in/mdes/mtf/connect/1/0/getEligibleTokenRequestors
```

#### Get Assets {#get-assets-1}

* Production
* Sandbox(MTF)

```Production
https://digital.api.mastercard.co.in/mdes/issuer-assets/1/0/asset/tokenrequestor/{AssetId}
```

```Sandbox(MTF)
https://digital.api.mastercard.co.in/mdes/mtf/issuer-assets/1/0/asset/tokenrequestor/{AssetId}
```

#### Push Multiple Accounts {#push-multiple-accounts-1}

* Production
* Sandbox(MTF)

```Production
https://digital.api.mastercard.co.in/mdes/connect/1/0/pushMultipleAccounts
```

```Sandbox(MTF)
https://digital.api.mastercard.co.in/mdes/mtf/connect/1/0/pushMultipleAccounts
```

## Next Steps {#next-steps}

Follow these sections in sequence to move from planning to implementation and validation:

* [Use Cases](https://developer.mastercard.com/mdes-token-connect/documentation/use-cases/index.md) to choose the provisioning flow that matches your product experience.
* [Tutorials and Guides](https://developer.mastercard.com/mdes-token-connect/documentation/tutorials-and-guides/index.md) to implement issuer-side flows and onboarding tasks.
* [API Reference](https://developer.mastercard.com/mdes-token-connect/documentation/api-reference/index.md) for request and response schemas.
