Skip to content

Portal API Specification

To retrieve the list of known portals, you need to execute a GET request on https://mydataserver.com/enterprises/{enterpriseId}/portals and you will get a response looking like, which is actually a wrapper around the Client API on Keycloak side:

{
  "@context": "https://github.com/datafoodconsortium/ontology/blob/master/src/DFC_TechnicalOntology.owl",
  "@id": "https://mydataserver.com/enterprises/{enterpriseId}/portals",
  "dfc-t:platforms": {  
    "@type": "rdf:List",
    "@list": [
      {
        "@id": "https://waterlooregionfood.ca/portal/profile",
        "@type": "dfc-t:Platform",
        "localId": "xxxxxxxxxxxxxxxxx",
        "title": "Waterloo Region Food Portal",
        "description": "A super duper portal for the waterloo region",
        "termsandconditions": "https://waterlooregionfood.ca/terms-and-conditions",
        "dfc-t:hasAssignedScopes": {
          "@type": "rdf:List",
          "@list": [
            {
               "@id": "https://mydataserver.com/producers/{producerId}/scopes/ReadEnterprise",
               "dfc-t:scope": "ReadEnterprise",
               "@type": "dfc-t:Scope"
            }
          ]
        }
      },
      {
        "@id": "https://anotherportal.ca/portal/profile",
        "@type": "dfc-t:Platform",
        "localId": "yyyyyyyyyyyyyyy",
        "title": "Another Food Portal",
        "description": "A super duper portal for another region",
        "termsandconditions": "https://anotherportal.ca/terms-and-conditions",
        "dfc-t:hasAssignedScopes": {
           "@type": "rdf:List",
           "@list": []
        }
      }
    ]
  }
}

@adrien so this one is important.

UPDATE: after @garethe comment here:

  • Change class dfc-t:portal to dfc-t:platform
  • Change URI structure from /producers/{producerId} to /enterprises/{enterpriseId}
  • The localId structure is specific to the actual system integrating the module, used to identify the given platform on the application
Edited by Benoit Alessandroni