When site owners go to install an app, they need to explicitly allow the app access to specific types of data, based on the scopes defined in the app’s manifest. ​

Connect dialog

When they click Connect, the app installs and is considered connected.

You use the App Deauthorize API to “break” that connection. The site owner will see a message saying that your app is disconnected. They will not be able to use your app until it’s reconnected.

Disconnecting an app

​You will need to handle any steps required to determine when the user can reconnect the app. If you don’t, the user can simply reconnect the app the next time they go to use it.

​More on the app installation flow here.

Fields

Name Description Type
user_id The unique ID of the authenticated user string
site_id ID of a Weebly site, unique to the currently authenticated user​ string
platform_app_id ​The client ID as shown in the Developer Admin portal. string
platform_app_version The version of the app that is being disconnected string
authorization_code OAuth code for this app instance. Will always return null. string
authorization_code_date Date the app was authorized. Returns null. string
scope Returns null. string
hidden Whether or not the app is hidden. boolean
snippet_code HTML code if the app is a snippet. string
status Current status of the app. Returns disconnected. string
source Where the app is installed from. Returns null. string
access_code OAuth access token. Returns null. string
created_date Date the app was first installed. Unix GMT Timestamp
updated_date Date the app was last updated. Unix GMT Timestamp

POST
Deauthorize an App on a Site

POST /v1/user/sites/{SITE_ID}/apps/{PLATFORM_APP_ID}/deauthorize

Disconnects and deauthorizes the given app on a site. No data is required for this POST call.
scope: no scope needed

Example CURL request:

curl --request POST \
    --url https://api.weebly.com/v1/user/sites/987654321/apps/1234/deauthorize \
    --header 'accept: application/vnd.weebly.v1+json' \
    --header 'content-type: application/json' \
    --header 'x-weebly-access-token: [YOUR_TOKEN]"' \

Example response:

{
    "user_id": "123456",
    "site_id": "987654321",
    "platform_app_id": "56789",
    "platform_app_version": "1.0.12",
    "authorization_code": null,
    "authorization_code_date": null,
    "access_code": null,
    "scope": null,
    "hidden": false,
    "snippet_code": null,
    "updated_date": 1491951171,
    "created_date": 1474057924,
    "status": "disconnected",
    "source": null
}

Help make these docs better!









Tags:
oauth apis