Updated on 2025-11-13 GMT+08:00

Calling Back Data on Facebook

Function

After the channel is configured, this callback interface is generated. This interface is configured on Facebook to verify the callback and is used to connect to the CC-Messaging.

Usage Description

  • Prerequisites
    • The Facebook channel has been successfully created.
    • For details, visit official document at https://developers.facebook.com/.

Interface Authentication

Compare the value of verifyCode in the channel configuration with that of hub.verify_token in the request. If they are the same, the authentication is successful.

Interface Prototype

Table 1 Interface prototype description

Method

GET

URL

https://{IP address}:{Port number}/social/on/facebook/{channelId}

{IP address}:{Port number} indicates the IP address and port number of the NSLB exposed externally.

{channelId} indicates the channel ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory or Not

Type

Description

Content-Type

Yes

String

The value is fixed at application/json; charset=UTF-8.

user-agent

Yes

String

An example for the value is facebookplatform/1.0 (+http://developers.facebook.com).

accept-encoding

Yes

String

An example for the value is deflate, gzip.

Table 3 Request body parameters

Parameter

Mandatory or Not

Type

Description

hub.mode

Yes

String

The value must be subscribe.

hub.verify_token

Yes

String

Verification information carried by Facebook.

hub.challenge

Yes

String

Response content after successful verification.

Response Parameters

If this interface is invoked successfully, no response is returned.

If this interface fails to be invoked, the corresponding status code and error description are returned.

Example

  • Request
    GET https://10.10.10.1/social/on/facebook/202106178632962090
    
    host : 10.10.10.2:28090
    connection : Keep-Alive
    x-forwarded-for : 10.10.10.3, 10.10.10.4
    x-real-ip : 10.10.10.5
    remote-host : 10.10.10.6
    accept : */*
    accept-encoding : deflate, gzip
    user-agent : facebookplatform/1.0 (+http://developers.facebook.com)
    
    {
        "hub.mode": "subscribe",
        "msgBody": "*********************",
        "hub.challenge": ""
    }
  • Response
    Status Code: 400
    response: "The token sent by facebook is not correct."