Openstad
  • Introductie
  • Projectmanagement
    • Algemene kaders
    • Participatieprocessen
      • Voorkeurspeiling
      • Wedstrijd
      • Participatief begroten
  • Digitale tools
    • OpenStad CMS basis
      • Inloggen
      • De bouwstenen
      • Live in-page editing
      • Bewerkmodus (Draft)
      • Versiebeheer
    • Participatieprocessen
      • Voorkeurspeiling
      • Wedstrijd
      • Participatief begroten
    • How-to's
      • Nieuwe site aanmaken
      • Nieuwe pagina's toevoegen
      • Pagina's vullen
      • Inzendingen uploaden
      • Inzendingen weergeven
      • Filteren en categoriseren van inzendingen
      • Likes verzamelen
      • Reacties en argumenten
      • Interactieve kaart
      • Polygonen
      • Newsletter
      • Moderatie
      • Unieke stemcodes
      • Stemmen
      • Gebruikersbeheer
      • Gebruikers anonimiseren per website
      • Inzendingen exporteren en importeren
      • Vormgeving & logo aanpassen
      • E-mail notificaties
    • Widgets referentie
      • Accordeon
      • Agenda
      • Arguments
      • Columns
      • Slider
      • Counter
      • Date countdown bar
      • Ideas map
      • Ideeën op een kaart (Kaart applicatie)
      • iFrame
      • Image
      • Info bar
      • Link or button
      • List
      • Like
      • Location
      • Participatory budgeting
      • Keuzewijzer
      • Keuzewijzer resultaten
      • Rich text
      • Resource admin buttons
      • Resource overview
      • Resource form
      • Resource representation
      • Resource raw widget
      • Resource image
      • Speech bubble
      • Share widgets
      • Title
      • User remove form
      • Video upload
      • Video 3d party
      • Vorige volgende knoppen
    • Algemeen
      • Terminologie
      • Waarschuwingen
      • Adminpanel
      • Adminpanel (beta)/React admin
      • Page Settings
      • OpenStad hoofdmenu
        • Tags
        • Global
        • Open palette
        • Clear cache
        • Pages
        • Users
        • Images
        • Files
        • Workflow
        • Logout
      • Styles for the container
      • Interactieve kaart thema iconen
      • Inzendingen (ideas)
      • Artikelen (articles)
      • Gebruikers (users)
      • Authenticatie methodes
      • Rollen
      • URL's
      • Testen
      • Raw
      • Resources
  • Technical documentation (English)
    • Architecture
    • Getting started
    • Deploying to production
      • Kubernetes
      • Installing on Digital ocean with Kubernetes
      • Backups
      • Deploying a custom image
    • Frontend: CMS
      • Apostrophe CMS
      • The Openstad version of ApostropheCMS
      • Using openstad-components
      • Configuration
    • Frontend: Components
      • Use and configuration
      • Publishing
      • Components
        • Choices Guide
        • Ideas On Map
    • Api
      • Site
      • Idea
      • Argument
      • Vote
      • Article
      • Newsletter Signup
      • User
      • Auth
      • Resource & Data permissions
      • Pagination and search
      • Email settings
      • Database migrations
      • API configuration
    • oAuth2
      • Oauth2 configuration
    • Management panel
      • Management Panel configuration
    • Image server
    • Contributing & versioning
    • Git flow
    • Roadmap
Powered by GitBook
On this page
  1. Technical documentation (English)
  2. Api

Site

GET /api/site/ list all sites

POST /api/site/ create a site

GET /api/site/:SITE_ID view one site

PUT /api/site/:SITE_ID update one site

DELETE /api/site/:SITE_ID delete one site

GET request are public, certain config data is excluded publicly. The post, put and delete are all admin only.

Site config

One of the crucial aspects of the Site is it's config option, it is saved in a JSON column. The site configuration for how site should handle voting, ideas, arguments, domains, what Database CMS uses, if Basic Auth is turned and and more.

This is the current default configuration:

{
  "config": {

    "allowedDomains": {
      "type": "arrayOfStrings"
    },

    "project": {
      "type": "object",
      "subset": {
        "endDate": {
          "type": "string"
        },
        "endDateNotificationSent": {
          "type": "boolean"
        },
        "projectHasEnded": {
          "type": "boolean"
        }
      }
    },

    "anonymize": {
      "type": "object",
      "subset": {
        "anonymizeUsersXDaysAfterEndDate": {
          "type": "int"
        },
        "warnUsersAfterXDaysOfInactivity": {
          "type": "int"
        },
        "anonymizeUsersAfterXDaysOfInactivity": {
          "type": "int"
        },
        "inactiveWarningEmail": {
          "type": "object",
          "subset": {
            "subject": {
              "type": "string"
            },
            "template": {
              "type": "string"
            }
          }
        }
      }
    },

    "basicAuth": {
      "type": "object",
      "subset": {
        "active": {
          "type": "boolean"
        },
        "user": {
          "type": "string"
        },
        "password": {
          "type": "string"
        }
      }
    },

    "cms": {
      "type": "object",
      "subset": {
        "dbName": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "hostname": {
          "type": "string"
        },
        "after-login-redirect-uri": {
          "type": "string"
        },
        "redirectURI": {
          "type": "string"
        },
        "widgetDisplaySettings": {
          "type": "object",
          "subset": {
            "beta": {
              "type": "boolean"
            },
            "deprecated": {
              "type": "boolean"
            },
            "visibleWidgets": {
              "type": "arrayOfStrings"
            }
          }
        }
      }
    },

    "notifications": {
      "type": "object",
      "subset": {
        "fromAddress": {
          "type": "string"
        },
        "projectmanagerAddress": {
          "type": "string"
        },
        "siteadminAddress": {
          "type": "string"
        }
      }
    },

    "email": {
      "type": "object",
      "subset": {
        "siteaddress": {
          "type": "string"
        },
        "thankyoumail": {
          "type": "object",
          "subset": {
            "from": {
              "type": "string"
            }
          }
        }
      }
    },

    "oauth": {
      "type": "objectsInObject",
      "subset": {
        "auth-server-url": {
          "type": "string"
        },
        "auth-client-id": {
          "type": "string"
        },
        "auth-client-secret": {
          "type": "string"
        },
        "auth-server-login-path": {
          "type": "string"
        },
        "auth-server-exchange-code-path": {
          "type": "string"
        },
        "auth-server-get-user-path": {
          "type": "string"
        },
        "auth-server-logout-path": {
          "type": "string"
        },
        "after-login-redirect-uri": {
          "type": "string"
        }
      }
    },

    "ideas": {
      "type": "object",
      "subset": {
        "canAddNewIdeas": {
          "type": "boolean"
        },
        "titleMinLength": {
          "type": "int"
        },
        "titleMaxLength": {
          "type": "int"
        },
        "summaryMinLength": {
          "type": "int"
        },
        "summaryMaxLength": {
          "type": "int"
        },
        "descriptionMinLength": {
          "type": "int"
        },
        "descriptionMaxLength": {
          "type": "int"
        },
        "minimumYesVotes": {
          "type": "int"
        },
        "showVoteButtons": {
          "type": "boolean"
        },
        "canEditAfterFirstLikeOrArg": {
          "type": "boolean"
        },
        "feedbackEmail": {
          "from": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "inzendingPath": {
            "type": "string"
          },
          "template": {
            "type": "string"
          }
        },
        "extraDataMustBeDefined": {
          "type": "boolean"
        },
        "extraData": {
          "type": "object"
        },
        "types": {
          "type": "arrayOfObjects",
          "subset": {
            "name": {
              "type": "string"
            },
            "label": {
              "type": "label"
            },
            "auth": {
              "type": "object"
            },
            "mapIcon": {
              "type": "string"
            },
            "listIcon": {
              "type": "string"
            },
            "buttonIcon": {
              "type": "string"
            },
            "buttonLabel": {
              "type": "string"
            },
            "backgroundColor": {
              "type": "string"
            },
            "textColor": {
              "type": "string"
            },
            "flag": {
              "type": "string"
            },
            "mapUploadedFlag": {
              "type": "string"
            },
            "mapFlagWidth": {
              "type": "string"
            },
            "mapFlagHeight": {
              "type": "string"
            },
            "Initialavailablebudget": {
              "type": "int"
            },
            "minimalBudgetSpent": {
              "type": "int"
            }
          }
        },
        "automaticallyUpdateStatus": {
          "isActive": {
            "type": "boolean"
          },
          "afterXDays": {
            "type": "int"
          }
        }
      }
    },

    "arguments": {
      "type": "object",
      "subset": {
        "new": {
          "type": "object",
          "subset": {
            "anonymous": {
              "type": "object",
              "subset": {
                "redirect": {
                  "type": "string"
                },
                "notAllowedMessage": {
                  "type": "string"
                }
              }
            },
            "showFields": {
              "type": "arrayOfStrings"
            }
          }
        },
        "isClosed": {
          "type": "boolean"
        },
        "closedText": {
          "type": "string"
        }
      }
    },

    "users": {
      "type": "object",
      "subset": {
        "extraDataMustBeDefined": {
          "type": "boolean"
        },
        "extraData": {
          "type": "object"
        },
        "canCreateNewUsers": {
          "type": "boolean"
        },
        "allowUseOfNicknames": {
          "type": "boolean"
        }
      }
    },

    "votes": {
      "type": "object",
      "subset": {
        "isViewable": {
          "type": "boolean"
        },
        "isActive": {
          "type": "boolean"
        },
        "isActiveFrom": {
          "type": "string"
        },
        "isActiveTo": {
          "type": "string"
        },
        "requiredUserRole": {
          "type": "string"
        },
        "mustConfirm": {
          "type": "boolean"
        },
        "withExisting": {
          "type": "enum",
          "values": [
            "error",
            "replace",
            "merge"
          ]
        },
        "voteType": {
          "type": "enum",
          "values": [
            "likes",
            "count",
            "budgeting",
            "count-per-theme",
            "budgeting-per-theme"
          ]
        },
        "voteValues": {
          "type": "enum",
          "values": [
            {
              "label": "voor",
              "value": "yes"
            },
            {
              "label": "tegen",
              "value": "no"
            }
          ]
        },
        "maxIdeas": {
          "type": "int"
        },
        "minIdeas": {
          "type": "int"
        },
        "minBudget": {
          "type": "int"
        },
        "maxBudget": {
          "type": "int"
        },
        "themes": {
          "type": "objectList",
          "elementSubset": {
            "minBudget": {
              "type": "int"
            },
            "maxBudget": {
              "type": "int"
            }
          }
        }
      }
    },

    "articles": {
      "type": "object",
      "subset": {
        "canAddNewArticles": {
          "type": "boolean"
        },
        "titleMinLength": {
          "type": "int"
        },
        "titleMaxLength": {
          "type": "int"
        },
        "summaryMinLength": {
          "type": "int"
        },
        "summaryMaxLength": {
          "type": "int"
        },
        "descriptionMinLength": {
          "type": "int"
        },
        "descriptionMaxLength": {
          "type": "int"
        },
        "minimumYesVotes": {
          "type": "int"
        },
        "canEditAfterFirstLikeOrArg": {
          "type": "boolean"
        },
        "feedbackEmail": {
          "from": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "inzendingPath": {
            "type": "string"
          },
          "template": {
            "type": "string"
          }
        },
        "extraDataMustBeDefined": {
          "type": "boolean"
        },
        "extraData": {
          "type": "object"
        }
      }
    },

    "polls": {
      "type": "object",
      "subset": {
        "canAddPolls": {
          "type": "boolean"
        },
        "requiredUserRole": {
          "type": "string"
        }
      }
    },

    "newslettersignup": {
      "type": "object",
      "subset": {
        "isActive": {
          "type": "boolean"
        },
        "autoConfirm": {
          "type": "boolean"
        },
        "confirmationEmail": {
          "type": "object",
          "subset": {
            "from": {
              "type": "string"
            },
            "subject": {
              "type": "string"
            },
            "url": {
              "type": "string"
            },
            "template": {
              "type": "string"
            }
          }
        }
      }
    },

    "host": {
      "status": null
    },

    "ignoreBruteForce": {
      "type": "arrayOfStrings"
    }
  }
}
PreviousApiNextIdea

Last updated 2 years ago