📌
Netcore - WhatsApp Business API
  • Introduction
  • Getting Started for business
  • Whatsapp use cases (Templates)
    • Ecommerce
    • Travel
    • Broking /Securities
    • Banks
    • Mutual Funds
    • Insurance
    • Automobile
    • Media/Events
    • Education
  • Error Codes
  • API for developers
    • Consent API
      • Manage Opt IN /Opt OUT
    • Message API
      • Send Text message
      • Send Media message
        • Send Media message using Media ID
        • Send Media message using URL
      • Send Location message
    • Template Message API
      • Template Message API
    • Media API
      • Upload Media
      • Get Media
      • Delete Media
  • Webhooks
    • Delivery Message
    • Incoming Message
      • Incoming message-media
      • Incoming message location
      • Incoming message-text
  • Button Feature
  • Encryption
  • Reports
    • Delivery reports
    • Conversation Logs
  • FAQs
    • Getting started
    • Accepting Netcore WA request
    • Getting Business manager verified
    • Getting Opt ins
    • Message Templates
    • Allowed Notification types
    • Registration
    • Whatsapp language settings
    • Disallowed notification types
    • Quality rating and message limits
    • Message templates
    • Media in whatsapp
    • Miscellaneous queries
  • Contact Us
Powered by GitBook
On this page
  • Request Body
  • Error Codes

Was this helpful?

  1. API for developers
  2. Consent API

Manage Opt IN /Opt OUT

PreviousConsent APINextMessage API

Last updated 5 years ago

Was this helpful?

This endpoint creates an OPTIN for a phone number or OPTOUT for a phone number.

Optin is a consent which is mandatory before sending whatsapp message to any number. Use this endpoint to store optin details for a number. Each and every message request will internally check optin first before attempting a actual message send.

If you want to optout for a phone number which was previously opted then use this endpoint.

URL:​

Method: POST

Parameters

Parameter

Description

Data Type

Required

type

Action: optin or optout a phone number

String

Yes

recipient

Phone number for optin. Phone number must be valid. Phone number must include a country code.

long

Yes

source

Source of optin

String

Yes

user_agent

User agent of a source

String

No

ip

Ip of a source of optin. If mentioned than it must be valid ip

String

No

Request Body

{ 
"type":"optin", 
"recipients":[ 
{ "recipient":"919869566055", 
"source":"WEB", 
"user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 
(KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36", 
"ip":"192.168.7.26" 
}]  
} 
 

In case of success

{ 
    "status": "success", 
    "message": "Optin successfully added." 
} 
  

Status is success means optin added successfully.

In case of failure

{ 
    "status": "failure", 
    "error": { 
        "code": "8006", 
        "message": " source cannot be empty." 
    } 
} 

According to error, code and message will change.

Error Codes

Code

Message

8006

type is required.

8006

type is invalid. type must be optin/optout.

8006

recipients is required.

8006

source cannot be empty.

8006

source value cannot be greater than 25 characters.

8006

Invalid recipient. Only numeric values allowed.

8006

recipient value cannot be less than 10 digits.

8006

recipient value cannot be greater than 15 digits.

https://waapi.pepipost.com/api/v2/consent/manage​/