LenderLink Docs
  • πŸ‘‹Welcome to LenderLink
  • Overview
    • πŸ’‘What we do
    • Members
    • πŸš€Release notes
  • Product Guides
    • πŸ“ͺAPI Integration guides
      • πŸ› οΈContributor API development guide
      • ⛏️Full Response Consumer API Integration guide
      • βž•Summary Block Consumer API Integration guide
      • Telco Score API
      • Loan Applications Check API
      • Payment Transaction Data API
      • Contributor Integration Options - Responsibility Split
      • Data Dictionary
    • Submitting Phone Numbers
      • Submitting via Email
      • Submitting via API
  • Backtesting Guides
    • Contributor's backtest guide
    • Back-testing process
Powered by GitBook
On this page
  • API Upload MSISDNs
  • Prepare the List of Phone Numbers
  • Hash the Phone Numbers Using SHA-512
  • Authentication
  • Endpoint: Upload MSISDNs
  • Request Headers
  • Request Body (JSON)
  • Validation
  • Error Handling
  • Server Error
  • Example Curl Request
Export as PDF
  1. Product Guides
  2. Submitting Phone Numbers

Submitting via API

API Upload MSISDNs

Prepare the List of Phone Numbers

Ensure the list of phone numbers is available and formatted correctly. The phone numbers must begin with the Philippines country code (63). Example format:

639170000001 639170000002 639170000003

Hash the Phone Numbers Using SHA-512

Use a tool that supports the SHA-512 algorithm to hash the phone numbers.

The CSV file should contain only one column with the hashed values of the phone numbers.

Authentication

Prerequisites

In order to obtain an API Token you first need to have client_id and client secret from the previous step.

Token Request Flow

To authenticate and obtain an OAuth token, follow the standard OAuth token request flow.

  • API URL

https://sandbox-app.lenderlink.ph/oauth/token
  • Grant Type

Use this grant type when the client is a server and does not require user authentication.

"grant_type": "client_credentials"
  • Requesting the Access Token

To request the Access Token, submit a POST request to the API URL, including the following body parameters in JSON format:


{
    "grant_type": "client_credentials",
    "client_id": "your client id",
    "client_secret": "your client secret",
    "scope": "full-access"
}
                                        
  • Handling the Token Response

Upon successful validation, the authorization server will respond with an access token:


{
    "token_type": "Bearer",
    "expires_in": 86400,
    "access_token": "eyJ0eXAiOiJKasd10sJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI5YTc4MzVm..."
}
                                        
  • Token Lifespan

Access tokens have a limited lifespan of 86400 seconds. Once the token expires, you can obtain a new one.

Endpoint: Upload MSISDNs

This API allows users to upload a list of MSISDNs (phone numbers) associated with a contributor.

URL:

POST https://sandbox-app.lenderlink.ph/api/mobile-phone/upload

Request Headers

Key
Value

Content-Type

application/json

Accept

application/json

Authorization

Bearer <token>

Request Body (JSON)

{
    "msisdns": [
        "94706ae07de698ee06d7716782c22e7cff507bf0d23b388dcec77d9dec6bfff393d37c0cf811b44ba77ff54a89c089c9c26c8f62a015d9b3860bcb369339ace3",
        "9dd3bac56f710d0a01cdc9af9df5be40e64f3f40e9510978a1fc937f24a68c0564d46834f12c86135bdcb48a6bfd5d781205383041b6e4105a24a84d2aa85f9a",
        "2cb88faba90a250561e07c42a7f65d4e86a5f3baced2b962cdcc9f660d3bc976fd7dd70ae59fcf26ce51d58aa8e0a1b271abb11dd7a1dd1f2ecd75d40a18621b",
        "fc8652e8bb0bf66db7e8f6a196e953c47dbbcc696f85229168f5d817ec3f7a4fa078b4b79a0ec9e4f4ef2399ae9145a6c262ec9000486de7834eea8d6258e690",
        "69e28301b2234f4b9bbabe2097665e860f34df2cf02c3ad4a8d5ed4a326892d0360e26efc48ee3b4ca234efa06a8a40ac0768a952c298f24812299bc99b7a98c"
    ]
}

Validation

  • msisdns: Required, must be an array with a maximum of 10000 entries.

  • msisdns.*: Each MSISDN must be a valid string with only low case letters and digits that should be 128 in total per string.

Error Handling

If validation fails, the following type of response will be returned:

{
    "message": "The given data was invalid.",
    "errors": {
        "msisdns": [
            "The msisdns field is required."
        ],
        "msisdns.*": [
            "Each msisdn must be a valid string."
        ]
    }
}

Status Code: 422 Unprocessable Entity

Server Error

If there’s an issue on the server (e.g., batch number generation fails),the response will be: :

{
    "error": "Failed to store MSISDNs"
}

Status Code: 500 Internal Server Error

Example Curl Request

curl -X POST https://sandbox-app.lenderlink.ph/mobile-phone/upload \
-H "Content-Type: application/json" \
-d '{
    "msisdns": [
        "94706ae07de698ee06d7716782c22e7cff507bf0d23b388dcec77d9dec6bfff393d37c0cf811b44ba77ff54a89c089c9c26c8f62a015d9b3860bcb369339ace3",
        "9dd3bac56f710d0a01cdc9af9df5be40e64f3f40e9510978a1fc937f24a68c0564d46834f12c86135bdcb48a6bfd5d781205383041b6e4105a24a84d2aa85f9a",
        "2cb88faba90a250561e07c42a7f65d4e86a5f3baced2b962cdcc9f660d3bc976fd7dd70ae59fcf26ce51d58aa8e0a1b271abb11dd7a1dd1f2ecd75d40a18621b",
        "fc8652e8bb0bf66db7e8f6a196e953c47dbbcc696f85229168f5d817ec3f7a4fa078b4b79a0ec9e4f4ef2399ae9145a6c262ec9000486de7834eea8d6258e690",
        "69e28301b2234f4b9bbabe2097665e860f34df2cf02c3ad4a8d5ed4a326892d0360e26efc48ee3b4ca234efa06a8a40ac0768a952c298f24812299bc99b7a98c"
    ]
}'
PreviousSubmitting via EmailNextContributor's backtest guide

Last updated 5 months ago