inter-API Login Flow

Introduction

It is the API documentation that shows the flow of login services.

Methods:

- LoginUser

- GetSMSVerificationCodeAndSendSMS

- ProcessSMSVerificationResult

How to Get Started

Step 1 - Sign Up & Register: To start building with our APIs, you'll need to sign up for account. Read our documentation on how to use the Inter-API services and secure your connection with the right electronic certificate

Step 2 - Get Subscription Key: To get your Subscription Key, you'll first need to Subscribe for a package on Products page.

Step 3 - Activate: Get your subscription key under profile menu. You can also add your applications here.

Step 4 - Test API Methods: Include your access token and the information needed for that API. From there, use the response for your application and you’re all set. Now you can start building applications with our API.

Step 5 - For Production: You 're now up and running on inter-API Portal. Submit for production When you’re finished testing, you may want to submit your app for production. If it seems like we’d be a good fit, we’ll look into it and do some testing together. Then, we’ll talk about next steps to move to production.

How it Works

You can login by calling the 3 methods in order.

LoginUser

The login process is performed by sending additional information about the user name, password and application. If the transaction is successful, information about the customer is included in the response.

The Epassword value in the request is obtained by converting the password entered from the application to byte array and creating the hash with the SHA512 algorithm. An example C # code is also shared below.

public static string CreatePasswordHash(string password)

{

    // password: 123456

    var sha512Managed = new System.Security.Cryptography.SHA512Managed();

    var passwordBytes = System.Text.Encoding.Default.GetBytes(password);

    var hashPasswordBytes = sha512Managed.ComputeHash(passwordBytes);

    var hashPassword = Convert.ToBase64String(hashPasswordBytes);

    // password: ujJTh2rta8ItSm/1PYQGxq2GQZXtFEq1yHYhtsIztUi66uaVbfNG7IwX9eoQ817jy8UUeX7X3dMUVGTioLq0Ew==

    return hashPassword;

}

Request

{
    "Header": {
        "AppKey": "***",
        "Channel": "API",
        "ChannelSessionId": "87uyT1po08dth4561xa",
        "ChannelRequestId": "1f28db2e-8c56-42ee-a32e-8e5030a8eaef"
    },
    "Parameters": [
        {
            "UserName": "yelzo",
            "EPassword": "ujJTh2rta8ItSm/1PYQGxq2GQZXtFEq1yHYhtsIztUi66uaVbfNG7IwX9eoQ817jy8UUeX7X3dMUVGTioLq0Ew==",
            "ApplicationVersion": "1.0.0",
            "OperatingSystem": "Android",
            "UserAgentString": "MOBILE_DIGER",
            "ClientId": "08a018541f6c7f19",
            "DeviceType": "And.Phn",
            "SoftwareVersion": "1.0.0"
        }
    ]
}

Response

{
    "$type": "ServiceResponseMessage",
    "Data": {
        "$type": "CustomerInformationMessage",
        "CustomerInfo": {
            "$type": "CustomerInformation",
            "Name": "FİNROD",
            "MiddleName": "FELAGUND",
            "LastName": "CHARACİFORMES",
            "ShortName": "FİNROD CHARACİFORMES",
            "ID": 101084202,
            "CustomerNo": 60098735,
            "PhoneList": [
                {
                    "$type": "PhoneInfo",
                    "Type": 3,
                    "Ischanged": false,
                    "CityCode": "556",
                    "Number": "3485014",
                    "CountryCode": "90",
                    "InternalNumber": "0"
                }
            ]
        }
    }
}

GetSMSVerificationCodeAndSendSMS

The verification code is created and sent as sms for the login user to verify sms.

Request

{
    "Header": {
        "AppKey": "***",
        "Channel": "API",
        "ChannelSessionId": "87uyT1po08dth4561xa",
        "ChannelRequestId": "9b45b578-afd2-4978-8da4-c9e6048b8b6e"
    },
    "Parameters": [
        {
            "CellPhoneNumber": "5051001020",
            "CustomerNumber": 60098735,
            "IsLogin": true,
            "CustomerIdentity": 101084202
        }
    ]
}

Response

{
    "$type": "ServiceResponseMessage",
    "Data": {
        "$type": "SMSVerificationCodeRequestMessage",
        "CustomerNumber": 60098735,
        "SMSVerificationCode": "039224",
        "CellPhoneNumber": "5051001020",
        "LanguageCode": "TR",
        "isLogin": true,
        "IsAlphanumericCode": false
    }
}

ProcessSMSVerificationResult

Sms verification result is reported with this method.

Request

{
    "Header": {
        "AppKey": "***",
        "Channel": "API",
        "ChannelSessionId": "87uyT1po08dth4561xa",
        "ChannelRequestId": "e64f0fc8-786d-45c3-9482-9f4f7db19b8d"
    },
    "Parameters": [
        {
            "IsLogin": true,
            "SMSVerificationResult": true,
            "CustomerIdentity": 101084202,
            "CustomerNo": 60098735
        }
    ]
}

Response

{
    "$type": "ServiceResponseMessage",
    "Data": {
        "$type": "SMSVerificationResultMessage",
        "SMSVerificationResult": true,
        "AuiditLogId": -1,
        "IsLogin": true,
        "IsExtraSMSProcess": false,
        "CustomerNo": 60098735,
        "State": 2
    }
}

Postman Collection: https://www.getpostman.com/collections/cb7b7c8a2c2a3578ed1b