Vendors (v2.0)

https://github.com/folio-org/mod-vendors

Table of contents

Contacts

CRUD APIs used to manage contacts.

/vendor-storage/contacts

Collection of contact items.

GET /vendor-storage/contacts

Get list of contact persons

GET /vendor-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 contactss in this collection",
        "type": "array",
        "id": "contacts",
        "items": {
          "type": "object",
          "$ref": "contact.json"
        }
      },
      "total_records": {
        "description": "The number of contact person records returned in this collection",
        "type": "integer"
      },
      "first": {
        "description": "The index of the first object in the collection",
        "type": "integer"
      },
      "last": {
        "description": "The index of the last object in the collection",
        "type": "integer"
      }
    },
    "additionalProperties": false,
    "required": [
      "contacts",
      "total_records"
    ]
  }
  

Example:

{
    "contacts": [
        {
            "id": "08e0eb27-b57f-4638-a703-9a2c57bd8708",
            "prefix": "Director",
            "first_name": "Nick",
            "last_name": "Fury",
            "language": "en-us",
            "notes": "SHIELD's Big Kahuna",
            "phone_numbers": [
                {
                    "phone_number": {
                        "phone_number": "19789999999"
                    },
                    "categories": [
                        "0e3f9680-ab06-4565-af64-609b7364e6eb",
                        "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
                    ],
                    "language": "en-us"
                }
            ],
            "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"
            ]
        }
    ],
    "total_records": 1,
    "first": 1,
    "last": 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 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /vendor-storage/contacts

Create a new contact item.

POST /vendor-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": "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}$"
    },
    "prefix": {
      "description": "The prefix for this contact person",
      "type": "string"
    },
    "first_name": {
      "description": "The first name of this contact person",
      "type": "string"
    },
    "last_name": {
      "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"
    },
    "phone_numbers": {
      "id": "phone_numbers",
      "description": "The list of phone numbers for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "phone_number.json"
      }
    },
    "emails": {
      "id": "email_addresses",
      "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": "contact_category",
      "description": "The list of contact categories for this vendor contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "category.json"
      }
    },
    "inactive": {
      "description": "Used to indicate that a contact is no longer active",
      "type": "boolean"
    }
  },
  "additionalProperties": false,
  "required": [
    "first_name",
    "last_name"
  ]
}

Example:

{
    "prefix": "Director",
    "first_name": "Nick",
    "last_name": "Fury",
    "language": "en-us",
    "notes": "SHIELD's Big Kahuna",
    "phone_numbers": [
        {
            "phone_number": {
                "phone_number": "19789999999"
            },
            "categories": [
                "0e3f9680-ab06-4565-af64-609b7364e6eb",
                "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
            ],
            "language": "en-us"
        }
    ],
    "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",
    "first_name": "Nick",
    "last_name": "Fury",
    "language": "en-us",
    "notes": "SHIELD's Big Kahuna",
    "phone_numbers": [
        {
            "phone_number": {
                "phone_number": "19789999999"
            },
            "categories": [
                "0e3f9680-ab06-4565-af64-609b7364e6eb",
                "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
            ],
            "language": "en-us"
        }
    ],
    "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 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /vendor-storage/contacts/{id}

Retrieve contact item with given {contactId}

GET /vendor-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": "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}$"
    },
    "prefix": {
      "description": "The prefix for this contact person",
      "type": "string"
    },
    "first_name": {
      "description": "The first name of this contact person",
      "type": "string"
    },
    "last_name": {
      "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"
    },
    "phone_numbers": {
      "id": "phone_numbers",
      "description": "The list of phone numbers for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "phone_number.json"
      }
    },
    "emails": {
      "id": "email_addresses",
      "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": "contact_category",
      "description": "The list of contact categories for this vendor contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "category.json"
      }
    },
    "inactive": {
      "description": "Used to indicate that a contact is no longer active",
      "type": "boolean"
    }
  },
  "additionalProperties": false,
  "required": [
    "first_name",
    "last_name"
  ]
}

Example:

{
    "id": "08e0eb27-b57f-4638-a703-9a2c57bd8708",
    "prefix": "Director",
    "first_name": "Nick",
    "last_name": "Fury",
    "language": "en-us",
    "notes": "SHIELD's Big Kahuna",
    "phone_numbers": [
        {
            "phone_number": {
                "phone_number": "19789999999"
            },
            "categories": [
                "0e3f9680-ab06-4565-af64-609b7364e6eb",
                "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
            ],
            "language": "en-us"
        }
    ],
    "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 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"contact not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /vendor-storage/contacts/{id}

Delete contact item with given {contactId}

DELETE /vendor-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 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /vendor-storage/contacts/{id}

Update contact item with given {contactId}

PUT /vendor-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": "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}$"
    },
    "prefix": {
      "description": "The prefix for this contact person",
      "type": "string"
    },
    "first_name": {
      "description": "The first name of this contact person",
      "type": "string"
    },
    "last_name": {
      "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"
    },
    "phone_numbers": {
      "id": "phone_numbers",
      "description": "The list of phone numbers for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "phone_number.json"
      }
    },
    "emails": {
      "id": "email_addresses",
      "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": "contact_category",
      "description": "The list of contact categories for this vendor contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "category.json"
      }
    },
    "inactive": {
      "description": "Used to indicate that a contact is no longer active",
      "type": "boolean"
    }
  },
  "additionalProperties": false,
  "required": [
    "first_name",
    "last_name"
  ]
}

Example:

{
    "id": "08e0eb27-b57f-4638-a703-9a2c57bd8708",
    "prefix": "Director",
    "first_name": "Nick",
    "last_name": "Fury",
    "language": "en-us",
    "notes": "SHIELD's Big Kahuna",
    "phone_numbers": [
        {
            "phone_number": {
                "phone_number": "19789999999"
            },
            "categories": [
                "0e3f9680-ab06-4565-af64-609b7364e6eb",
                "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
            ],
            "language": "en-us"
        }
    ],
    "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 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 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator