Citygate Family API v1

This API is part of the new family services provided by Citygate. In order to use these functions, you have to register a user at Citygate.

Newspapers Categories Locations Search Ad

Newspapers

  • URL: https://familyview.api.citygate.se/v1/newspapers?apiKey={guid}&groupId={int}
  • Parameters:
    • apiKey: (required) The unique guid given to you.
    • groupId: (optional) Tells the api what group to filter the newspapers on if the user is part of multiple groups. If not supplied, the default group is selected
  • Method: GET
  • Accept: application/xml, default is application/json if no accept-header is supplied
  • Limit: 1000 requests every hour
  • Cache: 100 seconds
  • Response:
    [
        {
            "Id": 2,
            "GroupId": 2,
            "Name": "GävleTidningar",
            "ShortName": "GD"
        },
        {
            "Id": 8,
            "GroupId": 2,
            "Name": "DT",
            "ShortName": "DT"
        },
        {
            "Id": 11,
            "GroupId": 2,
            "Name": "Sundsvalls Tidning och Dagbladet",
            "ShortName": "ST"
        },
        {
            "Id": 22,
            "GroupId": 2,
            "Name": "Tidningen Ångermanland",
            "ShortName": "TA"
        },
        {
            "Id": 23,
            "GroupId": 2,
            "Name": "Örnsköldsviks Allehanda",
            "ShortName": "OA"
        },
        {
            "Id": 36,
            "GroupId": 2,
            "Name": "Hälsingetidningar",
            "ShortName": "HT"
        },
        {
            "Id": 38,
            "GroupId": 2,
            "Name": "Dagbladet",
            "ShortName": "DB"
        },
        {
            "Id": 54,
            "GroupId": 2,
            "Name": "Östersunds-Posten",
            "ShortName": "OP"
        },
        {
            "Id": 68,
            "GroupId": 2,
            "Name": "Dalademokraten",
            "ShortName": "DD"
        }
    ]
                            

Returns a list of all the newspapers who belongs to the same groups as you.

Categories

  • URL: https://familyview.api.citygate.se/v1/categories?apiKey={guid}&groupId={int}&newspaperIds={int, ...}
  • Parameters:
    • apiKey: (required) The unique guid given to you.
    • groupId: (optional) If supplied, the functions returns all categories for the newspapers in that group.
    • newspaperIds: (int) comma sepatated list (optional) If supplied, the functions returns all categories for the given newspaper(s). Use to impersonate another newspaper in the same group. If not supplied, defaults to your registered newspaper.
  • Method: GET
  • Accept: application/xml, default is application/json if no accept-header is supplied
  • Limit: 1000 requests every hour
  • Cache: 100 seconds
  • Response:
    [
        {
            "Id": 22,
            "Name": "Hälsningar",
            "HasAds": true,
            "SubCategories":
            [
                {
                    "Id": 70,
                    "Name": "Dagens ros",
                    "HasAds": false
                },
                {
                    "Id": 71,
                    "Name": "Hälsningar",
                    "HasAds": true
                },
                {
                    "Id": 72,
                    "Name": "Tack",
                    "HasAds": true
                }
            ]
        },
        {
            "Id": 23,
            "Name": "Grattis",
            "HasAds": true,
            "SubCategories":
            [
                {
                    "Id": 80,
                    "Name": "Vi firar",
                    "HasAds": true
                },
                {
                    "Id": 82,
                    "Name": "Jubilarer & Milstenar",
                    "HasAds": false
                },
                {
                    "Id": 83,
                    "Name": "Uppvaktning",
                    "HasAds": true
                }
            ]
        }
    ]
                            

Returns basic info about your categories.

Locations

  • URL: https://familyview.api.citygate.se/v1/locations?groupId={int}&newspaperIds={int, ...}&apiKey={guid}
  • Parameters:
    • apiKey: (required) The unique guid given to you.
    • groupId: (optional) If supplied, the functions returns all locations in that group with ads.
    • newspaperIds: (optional) Comma sepatated list. If supplied, the functions returns all locations for the given newspaper(s) with ads. Use to impersonate another newspaper in the same group. If not supplied, defaults to your registered newspaper.
  • Method: GET
  • Accept: application/xml, default is application/json if no accept-header is supplied
  • Limit: 1000 requests every hour
  • Cache: 100 seconds
  • Response:
    [
       {
           "Name": "Västra götaland",
           "Cities":
           [
               {
                   "Name": "Ale",
                   "Districts":
                   [
                       {
                           "Name": "Älvängen",
                           "PostalCodes":
                           [
                               44633
                           ]
                       }
                   ]
               },
               {
                   "Name": "Borås",
                   "Districts":
                   [
                       {
                           "Name": "Borås",
                           "PostalCodes":
                           [
                               50110,
                               50434,
                               50495
                           ]
                       },
                       {
                           "Name": "Fristad",
                           "PostalCodes":
                           [
                               51391
                           ]
                       },
                       {
                           "Name": "Äspered",
                           "PostalCodes":
                           [
                               51692
                           ]
                       }
                   ]
               }
            ]
        }
    ]
                            

Returns all the locations where an ad has been created. Please note that querying this function with a groupId parameter may return a very large resultset