Page Association

A Page Association represents an association between two public pages (see Page) and is used for sharing content between pages. The direction of the Page Association has meaning and indicates that the from_page has associated itself with the to_page, allowing social posts from the to_page to appear on the from_page.

To create an association between pages, the User creating the association must have edit_resource permission on Page Associations.

Resource URIs

Item URI: /v7.0/page_association/{pk}/

Collection URI: /v7.0/page_association/

Item

Item Methods

GET Retrieve a Page Association by id DELETE Delete a Page Association by id (edit_resource permission on Page Associations is required)

self A link to this resource user A link to the User resource that owns the Page Association from_page Link to the from Page to_page Link to the to Page

Collection

Collection methods

GET Get a list of Page Associations. POST Create a Page Association. (edit_resource permission on Page Associations is required).

Collection query parameters

Name Description Type Required
from_page_id Get a list of all Page Associations from a page. number No
to_page_id Get a list of all Page Associations to a page. number No

Note: Both parameters can be used together to determine if there is an association of the specified direction between two pages.

self A link to this resource user A link to the User resource that owns the Page Association

Embedded collections

page_associations A collection of Page Associations with links as described under [Item links][]

Usage

GET Page Association entity

Request GET: /v7.0/page_association/8001991/
Response
{
    '_links': {
        'documentation': [
            {
                'href': 'https://developer.mapmyfitness.com/docs/v70_Page_Association/'
            }
        ],
        'from_page': [
            {
                'href': '/v7.0/page/1/',
                'id': '1'
            }
        ],
        'self': [
            {
                'href': '/v7.0/page_association/8001991/',
                'id': '8001991'
            }
        ],
        'to_page': [
            {
                'href': '/v7.0/page/2/',
                'id': '2'
            }
        ]
    }
}

PUT Page Association entity

Request PUT: /v7.0/page_association/{pk}/
{
    "input_payload":"here"
}
Response
{
    "output_payload":"here"
}

DELETE Page Association entity

Request DELETE: /v7.0/page_association/8001991/
Response
204 No Response

GET Page Association collection

Request GET: /v7.0/page_association/?from_page_id=1
Response
{
    '_embedded': {
        'page_associations': [
            {
                '_links': {
                    'from_page': [
                        {
                            'href': '/v7.0/page/1/',
                            'id': '1'
                        }
                    ],
                    'self': [
                        {
                            'href': '/v7.0/page_association/8001991/',
                            'id': '8001991'
                        }
                    ],
                    'to_page': [
                        {
                            'href': '/v7.0/page/2/',
                            'id': '2'
                        }
                    ]
                }
            },
            {
                '_links': {
                    'from_page': [
                        {
                            'href': '/v7.0/page/1/',
                            'id': '1'
                        }
                    ],
                    'self': [
                        {
                            'href': '/v7.0/page_association/4136742/',
                            'id': '4136742'
                        }
                    ],
                    'to_page': [
                        {
                            'href': '/v7.0/page/3/',
                            'id': '3'
                        }
                    ]
                }
            }
        ]
    },
    '_links': {
        'documentation': [
            {
                'href': 'https://developer.mapmyfitness.com/docs/v70_Page_Association/'
            }
        ],
        'self': [
            {
                'href': '/v7.0/page_association/?limit=20&from_page_id=1&offset=0'
            }
        ]
    },
    'total_count': 2
}

GET Page Association collection

Request GET: /v7.0/page_association/?to_page_id=2
Response
{
    '_embedded': {
        'page_associations': [
            {
                '_links': {
                    'from_page': [
                        {
                            'href': '/v7.0/page/1/',
                            'id': '1'
                        }
                    ],
                    'self': [
                        {
                            'href': '/v7.0/page_association/8001991/',
                            'id': '8001991'
                        }
                    ],
                    'to_page': [
                        {
                            'href': '/v7.0/page/2/',
                            'id': '2'
                        }
                    ]
                }
            }
        ]
    },
    '_links': {
        'documentation': [
            {
                'href': 'https://developer.mapmyfitness.com/docs/v70_Page_Association/'
            }
        ],
        'self': [
            {
                'href': '/v7.0/page_association/?limit=20&from_page_id=1&offset=0'
            }
        ]
    },
    'total_count': 1
}

GET Page Association collection

Request GET: /v7.0/page_association/?from_page_id=1&to_page_id=2
Response

Returns a single result if there is an association of this direction between two pages, otherwise returns an empty list.

{
    '_embedded': {
        'page_associations': [
            {
                '_links': {
                    'from_page': [
                        {
                            'href': '/v7.0/page/1/',
                            'id': '1'
                        }
                    ],
                    'self': [
                        {
                            'href': '/v7.0/page_association/8001991/',
                            'id': '8001991'
                        }
                    ],
                    'to_page': [
                        {
                            'href': '/v7.0/page/2/',
                            'id': '2'
                        }
                    ]
                }
            }
        ]
    },
    '_links': {
        'documentation': [
            {
                'href': 'https://developer.mapmyfitness.com/docs/v70_Page_Association/'
            }
        ],
        'self': [
            {
                'href': '/v7.0/page_association/?limit=20&from_page_id=1&offset=0'
            }
        ]
    },
    'total_count': 1
}

POST Page Association entity

Request POST: /v7.0/page_association/
{
    'from_page': '/v7.0/page/1/',
    'to_page': '/v7.0/page/2/'
}
Response
{
    'from_page': '/v7.0/page/1/',
    'to_page': '/v7.0/page/2/'
}