Organizations (v2.0)

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

Table of contents

Contacts

CRUD APIs used to manage contacts.

/organizations-storage/contacts

Collection of contact items.

GET /organizations-storage/contacts

Get list of contact persons

GET /organizations-storage/contacts
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 contact items

Body

Media type: application/json

Type: json

Content:

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

Example:

{
    "contacts": [
        {
            "id": "08e0eb27-b57f-4638-a703-9a2c57bd8708",
            "prefix": "Director",
            "firstName": "Nick",
            "lastName": "Fury",
            "language": "en-us",
            "notes": "SHIELD's Big Kahuna",
            "inactive": false,
            "phoneNumbers": [
             {
                 "phoneNumber": "19789999999",
                 "categories": [
                     "0e3f9680-ab06-4565-af64-609b7364e6eb",
                     "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
                 ],
                 "language": "en-us",
                 "type": "Office",
                 "isPrimary": true
             }
            ],
            "emails": [
                {
                    "email": {
                        "value": "noreply@folio.org",
                        "description": "Main"
                    },
                    "categories": [
                        "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                        "56288fe8-8037-44da-8395-01d2d106dc54"
                    ],
                    "language": "en-us"
                }
            ],
            "addresses": [
                {
                    "address": {
                        "addressLine1": "10 Estes Street",
                        "addressLine2": "",
                        "city": "Ipswich",
                        "stateRegion": "MA",
                        "zipCode": "01938",
                        "country": "USA"
                    },
                    "categories": [
                        "0e3f9680-ab06-4565-af64-609b7364e6eb",
                        "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6",
                        "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                        "56288fe8-8037-44da-8395-01d2d106dc54"
                    ],
                    "language": "en"
                }
            ],
            "urls": [
                {
                    "url": {
                        "value": "http://folio.org",
                        "description": ""
                    },
                    "language": "en-us",
                    "categories": [
                        "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                        "56288fe8-8037-44da-8395-01d2d106dc54"
                    ],
                    "notes": ""
                }
            ],
            "categories": [
                "08e0eb27-b57f-4638-a703-9a2c57bd8708",
                "a5da9c44-6619-403f-bd3b-f9bd2f63bc59",
                "da0272e4-7ff7-4ea8-9bc9-9d9cd5c81580",
                "ab18897b-0e40-4f31-896b-9c9adc979a88"
            ],
            "metadata": {
                "createdDate": "2018-05-19T00:00:00.000+0000",
                "createdByUserId": "16d1157c-d137-11e8-a8d5-f2801f1b9fd1"
            }
        }
    ],
    "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 contacts -- 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 contacts -- 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/contacts

Create a new contact item.

POST /organizations-storage/contacts
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 contact record",
  "type": "object",
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The unique id of this contact",
      "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}$"
    },
    "prefix": {
      "description": "The prefix for this contact person",
      "type": "string"
    },
    "firstName": {
      "description": "The first name of this contact person",
      "type": "string"
    },
    "lastName": {
      "description": "The last name of this contact person",
      "type": "string"
    },
    "language": {
      "description": "The preferred language for this contact person",
      "type": "string"
    },
    "notes": {
      "description": "The notes for this contact person",
      "type": "string"
    },
    "phoneNumbers": {
      "id": "phoneNumbers",
      "description": "The list of phone numbers for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "phone_number.json"
      }
    },
    "emails": {
      "id": "emailAddresses",
      "description": "The list of emails for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "email.json"
      }
    },
    "addresses": {
      "id": "addresses",
      "description": "The list of addresses for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "address.json"
      }
    },
    "urls": {
      "id": "urls",
      "description": "The list of URLs for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "url.json"
      }
    },
    "categories": {
      "id": "contactCategory",
      "description": "The list of contact categories associated with this organization contact person",
      "type": "array",
      "items": {
        "description": "UUID of the contact category",
        "type": "string",
        "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}$"
      }
    },
    "inactive": {
      "description": "Used to indicate that a contact is no longer active",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "firstName",
    "lastName"
  ]
}

Example:

{
    "prefix": "Director",
    "firstName": "Nick",
    "lastName": "Fury",
    "language": "en-us",
    "notes": "SHIELD's Big Kahuna",
    "inactive": false,
    "phoneNumbers": [
     {
         "phoneNumber": "19789999999",
         "categories": [
             "0e3f9680-ab06-4565-af64-609b7364e6eb",
             "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
         ],
         "language": "en-us",
         "type": "Office",
         "isPrimary": true
        }
    ],
    "emails": [
        {
            "email": {
                "value": "noreply@folio.org",
                "description": "Main"
            },
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en-us"
        }
    ],
    "addresses": [
        {
            "address": {
                "addressLine1": "10 Estes Street",
                "addressLine2": "",
                "city": "Ipswich",
                "stateRegion": "MA",
                "zipCode": "01938",
                "country": "USA"
            },
            "categories": [
                "0e3f9680-ab06-4565-af64-609b7364e6eb",
                "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6",
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en"
        }
    ],
    "urls": [
        {
            "url": {
                "value": "http://folio.org",
                "description": ""
            },
            "language": "en-us",
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "notes": ""
        }
    ],
    "categories": [
        "08e0eb27-b57f-4638-a703-9a2c57bd8708",
        "a5da9c44-6619-403f-bd3b-f9bd2f63bc59",
        "da0272e4-7ff7-4ea8-9bc9-9d9cd5c81580",
        "ab18897b-0e40-4f31-896b-9c9adc979a88"
    ]
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created contact item

Body

Media type: application/json

Type: any

Example:

{
    "prefix": "Director",
    "firstName": "Nick",
    "lastName": "Fury",
    "language": "en-us",
    "notes": "SHIELD's Big Kahuna",
    "inactive": false,
    "phoneNumbers": [
     {
         "phoneNumber": "19789999999",
         "categories": [
             "0e3f9680-ab06-4565-af64-609b7364e6eb",
             "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
         ],
         "language": "en-us",
         "type": "Office",
         "isPrimary": true
        }
    ],
    "emails": [
        {
            "email": {
                "value": "noreply@folio.org",
                "description": "Main"
            },
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en-us"
        }
    ],
    "addresses": [
        {
            "address": {
                "addressLine1": "10 Estes Street",
                "addressLine2": "",
                "city": "Ipswich",
                "stateRegion": "MA",
                "zipCode": "01938",
                "country": "USA"
            },
            "categories": [
                "0e3f9680-ab06-4565-af64-609b7364e6eb",
                "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6",
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en"
        }
    ],
    "urls": [
        {
            "url": {
                "value": "http://folio.org",
                "description": ""
            },
            "language": "en-us",
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "notes": ""
        }
    ],
    "categories": [
        "08e0eb27-b57f-4638-a703-9a2c57bd8708",
        "a5da9c44-6619-403f-bd3b-f9bd2f63bc59",
        "da0272e4-7ff7-4ea8-9bc9-9d9cd5c81580",
        "ab18897b-0e40-4f31-896b-9c9adc979a88"
    ]
}

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 contact -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create contacts -- 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/contacts/{id}

Retrieve contact item with given {contactId}

GET /organizations-storage/contacts/{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 Contact

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 contact record",
  "type": "object",
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The unique id of this contact",
      "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}$"
    },
    "prefix": {
      "description": "The prefix for this contact person",
      "type": "string"
    },
    "firstName": {
      "description": "The first name of this contact person",
      "type": "string"
    },
    "lastName": {
      "description": "The last name of this contact person",
      "type": "string"
    },
    "language": {
      "description": "The preferred language for this contact person",
      "type": "string"
    },
    "notes": {
      "description": "The notes for this contact person",
      "type": "string"
    },
    "phoneNumbers": {
      "id": "phoneNumbers",
      "description": "The list of phone numbers for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "phone_number.json"
      }
    },
    "emails": {
      "id": "emailAddresses",
      "description": "The list of emails for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "email.json"
      }
    },
    "addresses": {
      "id": "addresses",
      "description": "The list of addresses for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "address.json"
      }
    },
    "urls": {
      "id": "urls",
      "description": "The list of URLs for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "url.json"
      }
    },
    "categories": {
      "id": "contactCategory",
      "description": "The list of contact categories associated with this organization contact person",
      "type": "array",
      "items": {
        "description": "UUID of the contact category",
        "type": "string",
        "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}$"
      }
    },
    "inactive": {
      "description": "Used to indicate that a contact is no longer active",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "firstName",
    "lastName"
  ]
}

Example:

{
    "id": "08e0eb27-b57f-4638-a703-9a2c57bd8708",
    "prefix": "Director",
    "firstName": "Nick",
    "lastName": "Fury",
    "language": "en-us",
    "notes": "SHIELD's Big Kahuna",
    "inactive": false,
    "phoneNumbers": [
     {
         "phoneNumber": "19789999999",
         "categories": [
             "0e3f9680-ab06-4565-af64-609b7364e6eb",
             "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
         ],
         "language": "en-us",
         "type": "Office",
         "isPrimary": true
         
        }
    ],
    "emails": [
        {
            "email": {
                "value": "noreply@folio.org",
                "description": "Main"
            },
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en-us"
        }
    ],
    "addresses": [
        {
            "address": {
                "addressLine1": "10 Estes Street",
                "addressLine2": "",
                "city": "Ipswich",
                "stateRegion": "MA",
                "zipCode": "01938",
                "country": "USA"
            },
            "categories": [
                "0e3f9680-ab06-4565-af64-609b7364e6eb",
                "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6",
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en"
        }
    ],
    "urls": [
        {
            "url": {
                "value": "http://folio.org",
                "description": ""
            },
            "language": "en-us",
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "notes": ""
        }
    ],
    "categories": [
        "08e0eb27-b57f-4638-a703-9a2c57bd8708",
        "a5da9c44-6619-403f-bd3b-f9bd2f63bc59",
        "da0272e4-7ff7-4ea8-9bc9-9d9cd5c81580",
        "ab18897b-0e40-4f31-896b-9c9adc979a88"
    ],
    "metadata": {
        "createdDate": "2018-05-19T00:00:00.000+0000",
        "createdByUserId": "16d1157c-d137-11e8-a8d5-f2801f1b9fd1"
    }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"contact 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/contacts/{id}

Delete contact item with given {contactId}

DELETE /organizations-storage/contacts/{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 Contact

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 contact -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"contact 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/contacts/{id}

Update contact item with given {contactId}

PUT /organizations-storage/contacts/{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 Contact

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 contact record",
  "type": "object",
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The unique id of this contact",
      "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}$"
    },
    "prefix": {
      "description": "The prefix for this contact person",
      "type": "string"
    },
    "firstName": {
      "description": "The first name of this contact person",
      "type": "string"
    },
    "lastName": {
      "description": "The last name of this contact person",
      "type": "string"
    },
    "language": {
      "description": "The preferred language for this contact person",
      "type": "string"
    },
    "notes": {
      "description": "The notes for this contact person",
      "type": "string"
    },
    "phoneNumbers": {
      "id": "phoneNumbers",
      "description": "The list of phone numbers for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "phone_number.json"
      }
    },
    "emails": {
      "id": "emailAddresses",
      "description": "The list of emails for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "email.json"
      }
    },
    "addresses": {
      "id": "addresses",
      "description": "The list of addresses for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "address.json"
      }
    },
    "urls": {
      "id": "urls",
      "description": "The list of URLs for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "url.json"
      }
    },
    "categories": {
      "id": "contactCategory",
      "description": "The list of contact categories associated with this organization contact person",
      "type": "array",
      "items": {
        "description": "UUID of the contact category",
        "type": "string",
        "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}$"
      }
    },
    "inactive": {
      "description": "Used to indicate that a contact is no longer active",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "firstName",
    "lastName"
  ]
}

Example:

{
    "id": "08e0eb27-b57f-4638-a703-9a2c57bd8708",
    "prefix": "Director",
    "firstName": "Nick",
    "lastName": "Fury",
    "language": "en-us",
    "notes": "SHIELD's Big Kahuna",
    "inactive": false,
    "phoneNumbers": [
     {
         "phoneNumber": "19789999999",
         "categories": [
             "0e3f9680-ab06-4565-af64-609b7364e6eb",
             "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
         ],
         "language": "en-us",
         "type": "Office",
         "isPrimary": true
         
        }
    ],
    "emails": [
        {
            "email": {
                "value": "noreply@folio.org",
                "description": "Main"
            },
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en-us"
        }
    ],
    "addresses": [
        {
            "address": {
                "addressLine1": "10 Estes Street",
                "addressLine2": "",
                "city": "Ipswich",
                "stateRegion": "MA",
                "zipCode": "01938",
                "country": "USA"
            },
            "categories": [
                "0e3f9680-ab06-4565-af64-609b7364e6eb",
                "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6",
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en"
        }
    ],
    "urls": [
        {
            "url": {
                "value": "http://folio.org",
                "description": ""
            },
            "language": "en-us",
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "notes": ""
        }
    ],
    "categories": [
        "08e0eb27-b57f-4638-a703-9a2c57bd8708",
        "a5da9c44-6619-403f-bd3b-f9bd2f63bc59",
        "da0272e4-7ff7-4ea8-9bc9-9d9cd5c81580",
        "ab18897b-0e40-4f31-896b-9c9adc979a88"
    ],
    "metadata": {
        "createdDate": "2018-05-19T00:00:00.000+0000",
        "createdByUserId": "16d1157c-d137-11e8-a8d5-f2801f1b9fd1"
    }
}

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 contact -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"contact 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