Search code examples
restdotmailer

dotmailer request token from REST API


I struggle in call the REST API at Dotmailer.

he provide a document for call the OAuth and get the token. but it's always throws the same error.

Input is

Post Method URI: https://r1-app.dotmailer.com/OAuth2/Tokens.ashx JSON input is { "client_id" : "[email protected]", "redirect_uri" : null, "client_secret" : "XXXXXXXXXXXX", "grant_type": "authorization_code", "code":"MyServerCode", "test_mode":true } Out put is

{ "error": "invalid_request", "error_description": "There was a problem with the 'grant_type' parameter: The parameter is required." }

Anyone know the error.

Thanks in advance...


Solution

  • I think Dotmailer OAuth have some problem.
    I was used alternatively Basic Authentication method to access the dotmailer API.

    Base URI = https://api.dotmailer.com/v2/
    Header
    Content-type: application/json Authorization: Basic base64_convertion(username:password).

    Sample
    Content-type: application/json Authorization: Basic XXXXXXXXXXXXXXXX.
    Use WADL method.
    https://api.dotmailer.com/v2/help/wadl