Netmera Developer Guide
Netmera Docs
  • Netmera Developer Guide
  • Platforms
    • iOS
      • New iOS (Swift)
        • SDK Integration
        • Push Notifications
          • Delegate Methods
          • Widget and In-App Messages
          • Media Push
          • Carousel, Slider and Thumbnail Push
        • Deep Linking
          • Custom Deep Links
        • Sound & Vibration
        • Push Inbox
        • Events
        • Geofence & Location
        • User Attributes & Preferences
        • Advertising ID
        • Changelog
      • Former iOS (Objective-C)
        • SDK Integration
        • Push Notifications
          • Delegate Methods
          • Push Payload Receivers
          • Widget and In-App Messages
          • Customizing In-App Messages
          • Media Push
          • Carousel, Slider and Thumbnail Push
          • Custom Web View Presentation
          • Push Icon
        • Live Activities
        • Deep Linking
          • Custom Deep Links
        • Sound & Vibration
        • Push Inbox
        • Events
        • Geofence & Location
        • User Attributes & Preferences
        • Data Transfer
        • Advertising ID
        • SSL Pinning
        • Changelog
    • Android
      • SDK Integration
        • Huawei Integration
        • Huawei Message Receipt
        • Custom FCM and HMS Implementations
        • Android Integration FAQs
      • Push Notifications
        • Widget and In-App Messages
        • Push Callbacks
        • Custom Web View Presentation
        • Push Icon
      • Deep Linking
        • Custom Deep Links
      • Sound & Vibration
      • Push Inbox
      • Events
      • Geofence & Location
        • Background Location Permission
      • User & Attributes
      • Data Transfer
      • Advertising ID
      • App Tracking
      • SSL Pinning
      • Changelog
    • Web
      • SDK Setup
        • Self-Hosted SDK Setup
      • Mobile Web Push for iOS
      • Deep Linking
        • Custom Deep Links
      • Events
      • User & Attributes
    • React Native
      • SDK Integration
      • Push Notifications
        • Widget and In-App Messages
        • Push Callbacks
      • Deep Linking
        • Custom Deep Links
      • Sound & Vibration
      • Push Inbox
      • Events
      • Geofence & Location
      • User & Attributes
      • Changelog
    • Flutter
      • SDK Integration
        • Custom FCM and HMS Implementations
      • Push Notifications
        • Push Notification Permissions
        • Widget and In-App Messages
        • Flutter iOS Media Push
      • Deep Linking
        • Custom Deep Links
      • Sound & Vibration
      • Push Inbox
      • Events
      • Geofence & Location
      • User & Attributes
      • SSL Pinning
      • Changelog
    • Cordova
      • SDK Integration
      • Push Notifications
      • Sound & Vibration
      • Push Inbox
      • Events
      • User & Attributes
    • Unity
      • SDK Integration
      • Sound & Vibration
      • Events
      • User & Attributes
      • Changelog
  • Integrated Modules
    • Optimove
    • Adjust
    • Mixpanel
    • IYS Integration
    • VIA Integration
      • Short URL Consent Requests
      • OTP Consent Requests
        • OTP Confirmation Completion
      • VIA Email Rejection Link Generation
      • ETK Rejection via SMS
  • API Documentation
    • REST API
      • Setup
      • Notifications
      • Events
      • User & Device Management
      • Inbox Feature
      • GDPR
      • Error Responses
  • FAQs
    • Push Notifications FAQs
Powered by GitBook
On this page
  • Consent Requests with OTP
  • ETK Consent Parameters
  • Sample ETK Requests
  • ETK Request SMS OTP
  • ETK Request Email OTP
  • Invalid ETK Requests
  • Invalid ETK SMS OTP Request
  • Invalid ETK Email OTP Request
  • KVK Parameters
  • Sample KVK Requests
  • KVK Request SMS OTP
  • KVK Request Email OTP
  • Invalid KVK Requests
  • Invalid KVK SMS OTP
  • Invalid KVK Email OTP Request
  • ETK & KVK Requests
  • ETK & KVK SMS OTP Request
  • ETK & KVK Email OTP Request
  • Invalid ETK & KVK Requests
  • Invalid ETK & KVK SMS OTP Request
  • Invalid ETK & KVK Email OTP Request

Was this helpful?

  1. Integrated Modules
  2. VIA Integration

OTP Consent Requests

PreviousShort URL Consent RequestsNextOTP Confirmation Completion

Last updated 3 months ago

Was this helpful?

For a full version, please see the board.

1

Prepare the OTP Consent Form

Create an OTP consent form using your IYS Panel. Once the form is ready, submit it to IYS for approval.

2

Obtain IYS Approval

After IYS approves the form, it will be ready for use in API calls. The form ID provided by IYS will serve as the formId value in your requests.

3

Send the Consent Form to the User

Send an email or SMS to the user containing the OTP code. Use the API endpoint https://restapi.netmera.com/via/consent to share the code with the user.

4

Confirm API is used to submit the OTP

The user enters the OTP code they received. Use the API endpoint https://restapi.netmera.com/via/confirm to submit the OTP.

5

Confirmation Information Sent to the User

The user will receive a confirmation via email or SMS, detailing the permissions they selected and the status of their submission.

6

Consent Data Saved in Netmera

Netmera automatically saves the user’s permissions in the Netmera Panel. Synchronization occurs every 10 minutes to ensure the latest user preferences are reflected.

Consent Requests with OTP

1

Start the Consent Process

The process for obtaining ETK and/or KVKK begins by using the consent method. A consent request is sent to the recipient, which includes:

  • "Aydınlatma Metni" and "Onay Metni"

  • One-time password (OTP) for verification.

  • A requestId, which serves as a reference ID for the operation.

2

Recipient's Response

The recipient grants consent by responding with the OTP to the service provider. This confirms their approval for ETK and/or KVKK.

3

Verification

The confirm method is used to verify the OTP by submitting the recipient's OTP and the associated requestId.

4

Consent Finalization

If the provided OTP matches the one sent to the recipient:

  • ETK consent is recorded on behalf of the brand(s).

  • KVKK consent is recorded on behalf of the service provider.

5

Netmera Consent Update

After the consent is successfully validated, the recipient's ETK approval, including EMAIL/SMS notification preferences, is saved in the Netmera system.

ETK Consent Parameters

Parameter
Type
Description
Required

consentTypes

Array of Objects

Includes the consent type details.

Yes

title

String

Type of consent (e.g., ETK).

Yes

types

Array of Strings

Specifies the communication channel(s) through which the approval is requested.["ARAMA"] for phone calls

["MESAJ"] for messages

["ARAMA", "MESAJ"] for both

["EPOSTA"] for email

Yes

recipientType

String

Type of recipient (BIREYSEL or TACIR).

Yes

formId

String

ID of the form sent to the recipient.

Yes

recipient

String

Recipient's phone number or email address.

Yes

verificationType

String

Specifies the approval method (SMS or email OTP). For SMS, it is SMS_OTP, and for email, it is EPOSTA_OTP.

Yes

referenceID

String

This identifier is used to create or update user records in the Netmera system.

Yes

Sample ETK Requests

Notes:

  • Replace your_rest_api_key with your actual REST API key.

  • Ensure formId corresponds to a valid form ID from the IYS Web VIA Management portal.

  • Modify recipient with the actual recipient’s email or phone number based on your use case.

ETK Request SMS OTP

curl --location 'https://restapi.netmera.com/via/consent' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data '{
  "consentTypes": [
    {
      "title": "ETK",
      "types": [
        "MESAJ",
        "ARAMA"
      ],
      "recipientType": "BIREYSEL"
    }
  ],
  "formId": "your_formid",
  "recipient": "+90536.......",
  "verificationType": "SMS_OTP",
  "referenceId": "user1234"
}'

Successful Response (HTTP 200)

{
    "requestId": "requestid"
}

ETK Request Email OTP

curl --location 'https://restapi.netmera.com/via/consent' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data '{
  "consentTypes": [
    {
      "title": "ETK",
      "types": [
        "EMAIL"
      ],
      "recipientType": "BIREYSEL"
    }
  ],
  "formId": "your_formid",
  "recipient": "....@gmail.com",
  "verificationType": "EPOSTA_OTP",
  "referenceId": "user1234"
}'

Successful Response (HTTP 200)

{
    "requestId": "requestid"
}

Invalid ETK Requests

In case of a failed request, the response will include the following fields:

  • message (String): The error message that describes the issue with the request.

  • code (String): The error code from the IYS system indicating the specific issue.

  • value (String) (This field may return the invalid value depending on the type of error, or it may be omitted): The invalid value that caused the error.

Invalid ETK SMS OTP Request

Case: formId does not match the expected type for the given verificationType.

curl --location 'https://restapi.netmera.com/via/consent' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data '{
    "consentTypes": [
    {
      "title": "ETK",
      "types": [
        "MESAJ"
      ],
      "recipientType": "BIREYSEL"
    }
  ],
  "formId": "your_formid",
  "recipient": "+90536...",
  "verificationType": "SMS_OTP",
  "referenceId": "user1234"
}'

Error Response (HTTP 400)

{
    "message": "The provided verification type (verificationType) does not match the form type. Form type: SHORTURL",
    "code": "H1065"
}

Invalid ETK Email OTP Request

Case: recipientType is missing in the request body.

curl --location 'https://restapi.netmera.com/via/consent' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data '{
	 "consentTypes": [
    {
      "title": "ETK",
      "types": [
        "EPOSTA"
      ]
    }
  ],
  "formId": "your_formid",
  "recipient": "...@gmail.com",
  "verificationType": "EPOSTA_OTP",
  "referenceId": "user1234"
}'

Error Response (HTTP 400)

{
    "message": "JSON verisinde eksik alanlar: recipientType",
    "code": "H1090"
}

KVK Parameters

Field Name
Type
Requirement
Description

consentTypes

Array of Objects

Yes

Contains details about the type of consent requested.

title

String

Yes

Type of form sent to the recipient. For KVK consent, this field must be set as "KVK".

types

Array of Strings

Yes

Consent types for KVK. Possible values: "AYDINLATMA_METNI", "ACIK_RIZA_METNI", "YURTDISI_AKTARIM".

formId

String

Yes

verificationType

String

Yes

The method for obtaining consent. "SMS_OTP" for SMS and "EPOSTA_OTP" for email OTP.

recipient

String

Yes

Contact information of the recipient. Either a phone number or email address where the consent request will be sent.

personData

Object

Required for KVK

Contains recipient details if KVK consent requires personal information.

name

String

Required for KVK

Recipient's full name.

recipientIdNumber

String

Required for KVK

Recipient's Turkish ID number.

address

String

Required for KVK

Recipient's address information.

Sample KVK Requests

KVK Request SMS OTP

curl --location 'https://restapi.netmera.com/via/consent' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data '{
  "consentTypes": [
    {
      "title": "KVK",
      "types": [
        "ACIK_RIZA_METNI",
        "YURTDISI_AKTARIM"
      ],
      "personData": {
        "name": "name",
        "recipientIdNumber": "134........",
        "address": "address"
      }
    }
  ],
  "formId": "your_formid",
  "recipient": "+90536.......",
  "verificationType": "SMS_OTP",
  "referenceId": "user1234"
}'

Successful Response (HTTP 200)

{
    "requestId": "requestid"
}

KVK Request Email OTP

curl --location 'https://restapi.netmera.com/via/consent' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data '{
  "consentTypes": [
    {
      "title": "KVK",
      "types": [
        "ACIK_RIZA_METNI",
        "YURTDISI_AKTARIM"
      ],
      "personData": {
        "name": "name",
        "recipientIdNumber": "134........",
        "address": "address"
      }
    }
  ],
  "formId": "your_formid",
  "recipient": "....@gmail.com",
  "verificationType": "EPOSTA_OTP",
  "referenceId": "user1234"
}'

Successful Response (HTTP 200):

{
    "requestId": "requestid"
}

Invalid KVK Requests

In case of a failed request, the response will include the following fields:

  • message (String): The error message that describes the issue with the request.

  • code (String): The error code from the IYS system indicating the specific issue.

  • value (String) (This field may return the invalid value depending on the type of error, or it may be omitted): The invalid value that caused the error.

Invalid KVK SMS OTP

Case: The recipientIdNumber field contains an improperly formatted ID number.

curl --location 'https://restapi.netmera.com/via/consent' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data '{
 "consentTypes": [
    {
      "title": "KVK",
      "types": [
        "ACIK_RIZA_METNI",
        "YURTDISI_AKTARIM"
      ],
      "personData": {
        "name": "name",
        "recipientIdNumber": "134........",
        "address": "address"
      }
    }
  ],
  "formId": "cab8467e-6e58-43d0-abec-2aafc047255d",
  "recipient": "+90536.......",
  "verificationType": "SMS_OTP",
  "referenceId": "user1234"
}'

Error Response (HTTP 400)

{
    "message": "Girdiğiniz TC kimlik numarası: '134........' formata uygun değildir.",
    "code": "H1096"
}

Invalid KVK Email OTP Request

Case: The title field contains an unexpected value.

curl --location 'https://restapi.netmera.com/via/consent' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data '{
  "consentTypes": [
    {
      "title": "X",
      "types": [
        "ACIK_RIZA_METNI",
        "YURTDISI_AKTARIM"
      ],
      "personData": {
        "name": "name",
        "recipientIdNumber": "134........",
        "address": "address"
      }
    }
  ],
  "formId": "your_formid",
  "recipient": "....@gmail.com",
  "verificationType": "EPOSTA_OTP",
  "referenceId": "user1234"
}'

Error Response (HTTP 400)

{
    "message": "title alanı için gereken değerler: [ETK, KVK, ISG, FATURA, SADAKAT, DIJITAL_FATURA] olmalıdır.",
    "code": "H1013",
    "value": "[X]"
}

ETK & KVK Requests

For ETK approval: The request must include the following fields:

  1. Verification Method (verificationType)

  2. Recipient's Communication Address (recipient)

  3. Communication Channel (types)

  4. Recipient Type (recipientType)

  5. Approval Type (title)

  6. Form ID (formId) (The ID of the approval form to be sent to the recipient)

For KVK approval: The request must include the following fields:

  1. Verification Method (verificationType)

  2. Recipient's Communication Address (recipient)

  3. Recipient's Full Name (name)

  4. Recipient's National ID Number (recipientIdNumber)

  5. Recipient's Address Information (address)

  6. Approval Type (title)

  7. Form ID (formId) (The ID of the approval form to be sent to the recipient)

ETK & KVK SMS OTP Request

curl --location 'https://restapi.netmera.com/via/consent' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data '{
  "consentTypes": [
	  {
      "title": "ETK",
      "types": [
        "MESAJ",
        "ARAMA"
      ],
      "recipientType": "BIREYSEL"
    },
    {
      "title": "KVK",
      "types": [
        "ACIK_RIZA_METNI",
        "YURTDISI_AKTARIM"
      ],
      "personData": {
        "name": "name",
        "recipientIdNumber": "134........",
        "address": "address"
      }
    }
  ],
  "formId": "your_formid",
  "recipient": "+90536.......",
  "verificationType": "SMS_OTP",
  "referenceId": "user1234"
}'

Successful Response (HTTP 200)

{
    "requestId": "requestid"
}

ETK & KVK Email OTP Request

curl --location 'https://restapi.netmera.com/via/consent' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data '{
  "consentTypes": [
	  {
      "title": "ETK",
      "types": [
        "EMAIL"
      ],
      "recipientType": "BIREYSEL"
    },
    {
      "title": "KVK",
      "types": [
        "ACIK_RIZA_METNI",
        "YURTDISI_AKTARIM"
      ],
      "personData": {
        "name": "name",
        "recipientIdNumber": "134........",
        "address": "address"
      }
    }
  ],
  "formId": "your_formid",
  "recipient": "...@gmail.com",
  "verificationType": "EPOSTA_OTP",
  "referenceId": "user1234"
}'

Successful Response (HTTP Code: 200)

{
    "requestId": "requestid"
}

Invalid ETK & KVK Requests

In case of a failed request, the response will include the following fields:

  • message (String): The error message that describes the issue with the request.

  • code (String): The error code from the IYS system indicating the specific issue.

  • value (String) (This field may return the invalid value depending on the type of error, or it may be omitted): The invalid value that caused the error.

Invalid ETK & KVK SMS OTP Request

Case: personData field is missing.

curl --location 'https://restapi.netmera.com/via/consent' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data '{
  "consentTypes": [
	  {
      "title": "ETK",
      "types": [
        "MESAJ",
        "ARAMA"
      ],
      "recipientType": "BIREYSEL"
    },
    {
      "title": "KVK",
      "types": [
        "ACIK_RIZA_METNI",
        "YURTDISI_AKTARIM"
      ]
    }
  ],
  "formId": "your_formid",
  "recipient": "+90536.......",
  "verificationType": "SMS_OTP",
  "referenceId": "user1234"
}'

Error Response (HTTP 400)

{
    "message": "JSON verisinde eksik alanlar: personData",
    "code": "H1090"
}

Invalid ETK & KVK Email OTP Request

Case: types field is missing.

curl --location 'https://restapi.netmera.com/via/consent' \
--header 'X-netmera-api-key: your_rest_api_key' \
--header 'Content-Type: application/json' \
--data '{
  "consentTypes": [
	  {
      "title": "ETK",
      "types": [
        "EMAIL"
      ],
      "recipientType": "BIREYSEL"
    },
    {
      "title": "KVK",
      "personData": {
        "name": "name",
        "recipientIdNumber": "134........",
        "address": "address"
      }
    }
  ],
  "formId": "your_formid",
  "recipient": "...@gmail.com",
  "verificationType": "EPOSTA_OTP",
  "referenceId": "user1234"
}'

Error Response (HTTP 400):

{
    "message": "types alanı boş veya null olmamalıdır.",
    "code": "H1057"
}

ID of the form sent to the recipient. The corresponding consent form will be sent to the recipient based on this ID. Obtainable via the .

İYS Web
here