7span / laravel-whatsapp

MIT License
5 stars 4 forks source link

Integrate Login with Facebook to get access token and phone numbers list #5

Open keval-7span opened 1 year ago

keval-7span commented 1 year ago

Feature Request

Integrate Login with Facebook to get access token and phone numbers list.

Functions

Function Name: getOAuthUrl Arguments: Key Datatype Required
client_id String Yes
redirect_uri String Yes
response_type String Yes
scope Array Yes
extras JSON No

Response:

{
    "oauth_url": "https://www.facebook.com/dialog/oauth?...."
}
Function Name: verifyOAuthCode Arguments: Key Datatype Required
code String Yes
client_id String Yes
client_secret String Yes
redirect_uri String Yes

Response:

{
    "access_token": "<your_access_token>",
    "token_type": "bearer",
    "expires_in": <expires_in_next_milliseconds>
}
Function Name: getWhatsappBusinessAccountIds Arguments: Key Datatype Required
access_token String Yes
fields String No

Response:

{
    "data": {
        "app_id": "1274719766720926",
        "type": "USER",
        "application": "MyFirstApp",
        "data_access_expires_at": 1694511327,
        "expires_at": 1691919327,
        "is_valid": true,
        "issued_at": 1686735327,
        "scopes": [
            "business_management",
            "whatsapp_business_management",
            "whatsapp_business_messaging",
            "public_profile"
        ],
        "granular_scopes": [
            {
                "scope": "business_management",
                "target_ids": []
            },
            {
                "scope": "whatsapp_business_management",
                "target_ids": [
                    "108522602164840"
                ]
            },
            {
                "scope": "whatsapp_business_messaging",
                "target_ids": [
                    "108522602164840"
                ]
            }
        ]
    }
}
Function Name: getPhoneNumberForSpecificBusinessAccount Arguments: Key Datatype Required
whatsapp_business_account_id String Yes

Response:

{
    "data": [
        {
            "id": "108439988840907",
            "verified_name": "Vepaar Dev",
            "code_verification_status": "EXPIRED",
            "display_phone_number": "+91 87350 15900",
            "quality_rating": "UNKNOWN"
        }
    ]
}
binal-7span commented 1 year ago

@keval-7span - There is one query from my end.

Are displays and extras needed to add to the getOAuthUrl function?