Social Authorization

The following endpoint allows to connect social profiles and pages to Oktopost.

How it Works

Getting The Redirect URL

Example Request

curl -i https://api.oktopost.com/v2/social-authorization

Input

Field Description
network The social network you want to connect: Twitter, Facebook, Google, LinkedIn or Instagram
url The URL to redirect the user back to after authentication
type Type of entity to you want to add: group, profile (default) or page

Verifying The Result

Once a user has completed the social authentication process, they will be redirected to the URL stated in the first request. The URL will be appended with a single query parameter called okt which you will need to use in the following request in order to verify the result of the authentication process.

Note that this endpoint will produce different responses according to the entity type stated in the first request.

Example Request

curl -i https://api.oktopost.com/v2/social-authorization/591c6053d81978.11578446867279657339b29ad2799b11ca4ff883

Example Result

Single profile

This result means that the profile is connected to Oktopost and is ready for use.

{
    "Result": true,
    "Credential": {
        "Id": "003-001000000000000-10795428XXXXXXXXX",
        "Created": "2000-12-31 23:59:59",
        "Name": "John Doe's Twitter",
        "Status": "valid",
        "Network": "Twitter",
        "ImageLink": "",
        "NetworkUsername": "johndoe"
    }
}

Groups and pages

This result will list all the available groups or pages that the user can add to Oktopost. Note that a user may manage pages that he does not wish Oktopost to have access to. It is your responsibility to present the user with a choice of pages to select from.

{
    "Result": true,
    "token": "591c6053d81978.11578446867279657339b29ad2799b11ca4ff883",
    "data": [
        {
            "Id": "10795428XXXXXXXXX",
            "Name": "Acme Inc",
            "Network": "Facebook",
            "ImageLink": "",
            "NetworkUsername": "123456",
            "IsConnected": true
        }
    ]
}

Adding Groups and Pages

Once the user has selected the groups or pages they want to add, you will need to submit the list of comma separated Ids, based on the Id field from the previous response, back to Oktopost along with the token provided to you with the previous response.

Example Request

curl -i https://api.oktopost.com/v2/social-authorization/591c6053d81978.1157844686727965733a45fd2799b1?ids=123456,2343257 -X PUT

Feedback and Knowledge Base