Follow

Authenticate Consumer

The Authenticate service is provided for existing consumers to authenticate using their username and password. The username will be either an email address or mobile phone number depending on how the consumer had initially registered.  Login with username will typically be used when logging in via a browser.  

Attributes 

Attribute

Value

HTTP Codes

·        200 - OK

·        400 - Bad Request

·        500 - Internal Server Error

Path

/v3/consumers/authenticate

HTTP Method

POST

Support Formats

JSON, XML

Rate Limited

No

Cache Timeout

TBC

Secure

No

 

Request

The following table contains the details of a typical HTTP request for this service:

Type

Value

Header

POST /v3/consumers/authenticate HTTP/1.1

Host: merchant.api.vmob.co

Content-Type: application/json

Accept-Language: en-US

x-vmob-authorization: dm1vYi53aW5kb3dzLjE6

Body

{

    "grant_type"        : "password",

    "username"          : "02086628662",

    "password"          : "p@ssw0rd1"

}

Required Fields

grant_type should be "password"

username

password

 

Successful Response

The following table contains the details of a typical successful HTTP request for this service.

Type

Value

Header

HTTP/1.1 200 OK

Content-Type: application/json

Cache-Control: no-store

Pragma: no-cache

Body

{    
"externalConsumerIdToken":"MjAxNjA5MDYyMzU0MTRiMjExZDI0NDNmOTM0MjhmYjhhZTM0ZjVhYmUxNGJjMmJlN2VkMjAxLTk3YjUtNDI5NC04ZThhLWJiNTNkNWVlNmY2Mw=="
}

Unsuccessful Response

The following table contains the details of a typical unsuccessful HTTP request for this service.

Type

Value

Header

HTTP/1.1 400 Bad Request

Content-Type: application/json

Cache-Control: no-store

Pragma: no-cache

Body

{

    "error"       : "invalid_request",

    "error_description"  : "The authorization grant type is not supported by the authorization server.",

    "systemInformation" :

    {

        "exception"      :
{

        "type"       :"VMob.Api.OAuth.GrantTypeNotSupportException",

        "message"    : "The grant type 'p@ssword' is invalid. Only grant type 'password' is supported by the Api.",

        "stackTrace" : "..."

        }

    }

}

}

Notes:
  • The error and error_description elements are defined and implemented in accordance with Section 5.2 of the OAuth specification for detailed error information.
  • The systemInformation element will contain detailed debug internal server information about the failure but will only appear if the server is configured to produce this information on failure.
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.