GET /api/v1/countries
List Country Mandates

Examples

GET /foundry-api/v1/countries
200
{
  "data": [
    {
      "id": "5",
      "type": "countries",
      "links": {
        "self": "http://test.host/foundry-api/v1/countries/5"
      },
      "attributes": {
        "slug": "singapore",
        "useful-links": [],
        "name": "Singapore",
        "total-insights": 0
      },
      "relationships": {
        "classification-distribution": {
          "links": {
            "self": "http://test.host/foundry-api/v1/countries/5/relationships/classification-distribution",
            "related": "http://test.host/foundry-api/v1/countries/5/classification-distribution"
          }
        },
        "geographies": {
          "links": {
            "self": "http://test.host/foundry-api/v1/countries/5/relationships/geographies",
            "related": "http://test.host/foundry-api/v1/countries/5/geographies"
          }
        }
      }
    }
  ],
  "meta": {
    "record-count": 1
  }
}

GET /api/v1/countries/:id
Show a Country Mandate

Examples

GET /foundry-api/v1/countries/1
400
{
  "errors": [
    {
      "title": "No authorization provided."
    }
  ]
}

Params

Param name Description
id
required

Country ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.


POST /api/v2/countries
Create a Country Mandate

Examples

POST /foundry-api/v1/countries
{
  "data": {
    "type": "countries",
    "attributes": {
      "slug": null,
      "useful-links": [],
      "name": "Singapore",
      "total-insights": "0"
    },
    "relationships": {}
  }
}
201
{
  "data": {
    "id": "9",
    "type": "countries",
    "links": {
      "self": "http://test.host/foundry-api/v1/countries/9"
    },
    "attributes": {
      "slug": "singapore-f367dde3-d252-4c75-86aa-e2316f04d9f1",
      "useful-links": [],
      "name": "Singapore",
      "total-insights": 0
    },
    "relationships": {
      "classification-distribution": {
        "links": {
          "self": "http://test.host/foundry-api/v1/countries/9/relationships/classification-distribution",
          "related": "http://test.host/foundry-api/v1/countries/9/classification-distribution"
        }
      },
      "geographies": {
        "links": {
          "self": "http://test.host/foundry-api/v1/countries/9/relationships/geographies",
          "related": "http://test.host/foundry-api/v1/countries/9/geographies"
        }
      }
    }
  }
}

PATCH /api/v2/countries/:id
Update a Country Mandate

Examples

PATCH /foundry-api/v1/countries/17
{
  "data": {
    "id": "17",
    "type": "countries",
    "attributes": {
      "slug": "singapore",
      "useful-links": [],
      "name": "USA",
      "total-insights": "0"
    },
    "relationships": {}
  }
}
200
{
  "data": {
    "id": "17",
    "type": "countries",
    "links": {
      "self": "http://test.host/foundry-api/v1/countries/17"
    },
    "attributes": {
      "slug": "singapore",
      "useful-links": [],
      "name": "USA",
      "total-insights": 0
    },
    "relationships": {
      "classification-distribution": {
        "links": {
          "self": "http://test.host/foundry-api/v1/countries/17/relationships/classification-distribution",
          "related": "http://test.host/foundry-api/v1/countries/17/classification-distribution"
        }
      },
      "geographies": {
        "links": {
          "self": "http://test.host/foundry-api/v1/countries/17/relationships/geographies",
          "related": "http://test.host/foundry-api/v1/countries/17/geographies"
        }
      }
    }
  }
}

Params

Param name Description
id
required

Country ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.


DELETE /api/v2/countries/:id
Delete a Country Mandate

Examples

DELETE /foundry-api/v1/countries/22
401
{
  "errors": [
    {
      "title": "You are not authorized to access this request"
    }
  ]
}

Params

Param name Description
id
required

Country ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.