WhatsApp Optin API

Use the WhatsApp Optin APIs to create opt-ins, update opt-in or opt-out status, and check whether a phone number has opted in to receive WhatsApp messages.

API overview

Create Optin

Create optin for the WhatsApp Business account.

Create Optin and Optout

Create optin/optout for the WhatsApp Business account.

Check Optin

Check if a phone number has opted-in to receive messages from the WhatsApp Business account.

Endpoint summary

APIPurposeURL
Create OptinCreate optin for the WhatsApp Business account.https://apis.rmlconnect.net/wbo/v2/optin/store
Create Optin and OptoutCreate optin/optout for the WhatsApp Business account.https://apis.rmlconnect.net/wbo/v2/optinout/store
Check OptinCheck optin if a particular phone number has opted-in to receive messages from the WhatsApp Business account.https://apis.rmlconnect.net/wbo/v2/optin/check

Create Optin

Create optin for the WhatsApp Business account.

Endpoint details

FieldValue
URLhttps://apis.rmlconnect.net/wbo/v2/optin/store
Authorizationjwt
API Keyjwt
Header parameter nameAuthorization
Request Body schemaapplication/json

Request sample

{
  "extra": "{extra}",
  "msisdn": "{phone number with + and country code}",
  "optin_channel": "whatsapp-api/third-party/sms/landing-page/email/voice/missed-call/physical-form"
}

Request body parameters

ParameterRequiredTypeDescription
msisdnYesstringThe phone number with '+' and country code for the user opting in.
optin_channelYesstringThe channel through which the user opted in.
extraNostringAny additional information related to the optin process.

Create Optin responses

201 Created

Response

{
  "status": "success",
  "message": "api execution successful",
  "details": "given 'msisdn' is not opted in for user Demo8"
}

Response Schema: application/json

FieldTypeDescription
statusstringThe status of the message delivery.
messagestringThe message response.
detailsstringThe details of the message.
401 Authentication Failure

Response

{
  "message": "Unable to process request",
  "status": "Failed",
  "reason": "Please check the integrity or validity of the token sent."
}

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
reasonstringThe reason for not processing the product feed update request.
statusstringThe status of the product feed update.
404 Page Not Found

Response

{
  "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}

Response Schema: application/json

FieldTypeDescription
messagestringThe message response.
422 Unprocessable Entity (WebDAV)

Response

{
  "message": "unable to process request",
  "status": "failed",
  "error": {
    "optin_channel": [
      "Unknown field."
    ]
  }
}

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
statusstringThe status for the optin.
errorobjectThe error for not processing the optin request.
500 Internal Server Error

Response

{
  "status": "failed",
  "message": "unable to process request",
  "reason": "reason"
}

Response Schema: application/json

FieldTypeDescription
statusstringThe status for creating optin.
messagestringThe response message.
reasonstringThe reason for not processing the request.

Create Optin and Optout

Create optin/optout for the WhatsApp Business account.

Endpoint details

FieldValue
URLhttps://apis.rmlconnect.net/wbo/v2/optinout/store
Authorizationjwt
API Keyjwt
Header parameter nameAuthorization
Request Body schemaapplication/json

Request sample

{
  "extra": "{extra}",
  "msisdn": "{phone number with + and country code}",
  "optin_channel": "whatsapp-api/third-party/sms/landing-page/email/voice/missed-call/physical-form",
  "status": "optin/optout"
}

Request body parameters

ParameterRequiredTypeDescription
msisdnYesstringThe phone number with '+' and country code for the user opting in.
optin_channelYesstringThe channel through which the user opted in.
extraNostringAny additional information related to the optin process.
statusYesstringStatus which implies whether user is being opt-in or opt out.

Create Optin and Optout responses

201 Created

Response

{
  "status": "success",
  "message": "api execution successful",
  "details": "given 'msisdn' is now opted out  for user <channel_name>"
}

Response Schema: application/json

FieldTypeDescription
statusstringThe status of the message delivery.
messagestringThe message response.
detailsstringThe details of the message.
401 Authentication Failure

Response

{
  "message": "Unable to process request",
  "status": "Failed",
  "reason": "Please check the integrity or validity of the token sent."
}

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
reasonstringThe reason for not processing the product feed update request.
statusstringThe status of the product feed update.
404 Page Not Found

Response

{
  "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}

Response Schema: application/json

FieldTypeDescription
messagestringThe message response.
422 Unprocessable Entity (WebDAV)

Response

{
  "message": "unable to process request",
  "status": "failed",
  "error": {
    "optin_channel": [
      "Unknown field."
    ]
  }
}

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
statusstringThe status for the optin.
errorobjectThe error for not processing the optin request.
500 Internal Server Error

Response

{
  "status": "failed",
  "message": "unable to process request",
  "reason": "reason"
}

Response Schema: application/json

FieldTypeDescription
statusstringThe status for creating optin.
messagestringThe response message.
reasonstringThe reason for not processing the request.

Check Optin

Check optin if a particular phone number has opted-in to receive messages from the WhatsApp Business account.

Endpoint details

FieldValue
URLhttps://apis.rmlconnect.net/wbo/v2/optin/check
Authorizationjwt
API Keyjwt
Header parameter nameAuthorization

Query parameters

ParameterRequiredTypeDescription
msisdnYesstringThe phone number with '+' and country code for the user opting in.

Check Optin responses

200 Success

Response

{
  "status": "success",
  "message": "api execution successful",
  "details": "Given 'msisdn' is not opted in  'channel' missed-call"
}

Response Schema: application/json

FieldTypeDescription
statusstringThe status for check optin.
messagestringThe response message.
detailsstringThe optin details.
401 Authentication Failure

Response

{
  "message": "Unable to process request",
  "status": "Failed",
  "reason": "Please check the integrity or validity of the token sent."
}

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
reasonstringThe reason for not processing the product feed update request.
statusstringThe status of the product feed update.
404 Page Not Found

Response

{
  "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}

Response Schema: application/json

FieldTypeDescription
messagestringThe message response.
422 Unprocessable Entity (WebDAV)

Response

{
  "message": "unable to process request",
  "status": "failed",
  "error": {
    "msisdn": [
      "Field may not be null."
    ]
  }
}

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
statusstringThe optin status of msisdn.
errorobject (inline_response_422_5_error)The error details.
500 Internal Server Error

Response

{
  "status": "failed",
  "message": "unable to process request",
  "reason": "reason"
}

Response Schema: application/json

FieldTypeDescription
statusstringThe status for check optin.
messagestringThe response message.
reasonstringThe reason for not processing the request.


Did this page help you?