Organizations (v2.0)

https://github.com/folio-org/mod-organizations-storage

Table of contents

Deprecated. Phone Numbers

CRUD APIs used to manage phone numbers. These APIs are not currently in use and may at some point be removed or resurrected

/organizations-storage/phone-numbers

Collection of phone-number items.

GET /organizations-storage/phone-numbers

Get list of phone_numbers

GET /organizations-storage/phone-numbers
Query Parameters
  • query: (string)

    A query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    with valid searchable fields: for example code

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    ["code", "MEDGRANT", "="]
    
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0
  • limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)

    Limit the number of elements returned in the response

    Example:

    10
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of phone-number items

Body

Media type: application/json

Type: json

Content:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Collection of phone numbers",
    "type": "object",
    "properties": {
      "phoneNumbers": {
        "description": "The list of phone numbers in this collection",
        "type": "array",
        "id": "phoneNumbers",
        "items": {
          "type": "object",
          "$ref": "phone_number.json"
        }
      },
      "totalRecords": {
        "description": "The number of phone numbers returned in this collection",
        "type": "integer"
      }
    },
    "additionalProperties": false,
    "required": [
      "phoneNumbers",
      "totalRecords"
    ]
  }

Example:

{
    "phoneNumbers": [
        {
            "id": "588b5c42-8634-4af7-bc9b-5e0116ed96b6",
            "phoneNumber": "19789999999",
             "metadata": {
                "createdDate": "2019-06-08T00:00:00.000+0000",
                "createdByUserId": "12d2457c-d137-11e8-a8d5-f2802f1b9fd1"
             }
        }
    ],
    "totalRecords": 1
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

unable to list phone-numbers -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list phone-numbers -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /organizations-storage/phone-numbers

Create a new phone-number item.

POST /organizations-storage/phone-numbers
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A phone number record",
  "type": "object",
  "properties": {
    "id": {
      "type": ["string", "null"],
      "description": "UUID",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
    },
    "phoneNumber": {
      "description": "The entire sequence of digits for this phone number",
      "type": "string"
    },
    "categories": {
      "id": "categories",
      "description": "The list of categories for this organization phone",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "type": {
      "description": "The type of this phone number",
      "type": "string",
       "enum": [
         "Office",
         "Mobile",
         "Fax",
         "Other"
      ]
    },
    "isPrimary": {
      "description": "Used to set this phone number as primary for the contact",
      "type": "boolean"
    },
    "language": {
      "description": "The language for this organization phone",
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "phoneNumber"
  ]
}

Example:

{
    "phoneNumber": "19789999999",
    "language": "en-us",
     "categories": [
        "0e3f9680-ab06-4565-af64-609b7364e6eb",
        "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
     ],
    "type": "Office",
    "isPrimary": true
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created phone-number item

Body

Media type: application/json

Type: any

Example:

{
    "phoneNumber": "19789999999",
    "language": "en-us",
     "categories": [
        "0e3f9680-ab06-4565-af64-609b7364e6eb",
        "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
     ],
    "type": "Office",
    "isPrimary": true
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to add phone-number -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create phone-numbers -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /organizations-storage/phone-numbers/{id}

Retrieve phone-number item with given {phone-numberId}

GET /organizations-storage/phone-numbers/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a Phone Number

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A phone number record",
  "type": "object",
  "properties": {
    "id": {
      "type": ["string", "null"],
      "description": "UUID",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
    },
    "phoneNumber": {
      "description": "The entire sequence of digits for this phone number",
      "type": "string"
    },
    "categories": {
      "id": "categories",
      "description": "The list of categories for this organization phone",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "type": {
      "description": "The type of this phone number",
      "type": "string",
       "enum": [
         "Office",
         "Mobile",
         "Fax",
         "Other"
      ]
    },
    "isPrimary": {
      "description": "Used to set this phone number as primary for the contact",
      "type": "boolean"
    },
    "language": {
      "description": "The language for this organization phone",
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "phoneNumber"
  ]
}

Example:

{
    "phoneNumber": "19789999999",
    "language": "en-us",
     "categories": [
        "0e3f9680-ab06-4565-af64-609b7364e6eb",
        "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
     ],
    "type": "Mobile",
    "isPrimary": true,
    "metadata": {
        "createdDate": "2019-06-08T00:00:00.000+0000",
        "createdByUserId": "12d2457c-d137-11e8-a8d5-f2802f1b9fd1"
    }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"phone-number not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /organizations-storage/phone-numbers/{id}

Delete phone-number item with given {phone-numberId}

DELETE /organizations-storage/phone-numbers/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a Phone Number

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to delete phone-number -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"phone-number not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /organizations-storage/phone-numbers/{id}

Update phone-number item with given {phone-numberId}

PUT /organizations-storage/phone-numbers/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a Phone Number

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A phone number record",
  "type": "object",
  "properties": {
    "id": {
      "type": ["string", "null"],
      "description": "UUID",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
    },
    "phoneNumber": {
      "description": "The entire sequence of digits for this phone number",
      "type": "string"
    },
    "categories": {
      "id": "categories",
      "description": "The list of categories for this organization phone",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "type": {
      "description": "The type of this phone number",
      "type": "string",
       "enum": [
         "Office",
         "Mobile",
         "Fax",
         "Other"
      ]
    },
    "isPrimary": {
      "description": "Used to set this phone number as primary for the contact",
      "type": "boolean"
    },
    "language": {
      "description": "The language for this organization phone",
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "phoneNumber"
  ]
}

Example:

{
    "phoneNumber": "19789999999",
    "language": "en-us",
     "categories": [
        "0e3f9680-ab06-4565-af64-609b7364e6eb",
        "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
     ],
    "type": "Mobile",
    "isPrimary": true,
    "metadata": {
        "createdDate": "2019-06-08T00:00:00.000+0000",
        "createdByUserId": "12d2457c-d137-11e8-a8d5-f2802f1b9fd1"
    }
}

Response 204

Item successfully updated

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to update phone-number -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"phone-number not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator