Provider Custom Attributes

Custom Attributes can be managed for Providers. This is done via the custom_attributes sub-collection as follows:

/api/providers/:id/custom_attributes

Querying Provider Custom Attributes

Custom attributes of a Provider can be asked for by expanding the subcollection as follows:

GET /api/providers/:id?expand=custom_attributes

Optionally, just the custom attributes of a Provider can be queried:

GET /api/providers/:id/custom_attributes

Specifying Attribute Actions

Custom attributes are specified as follows:

{
  "name" : "...",
  "value" : "...",
  "section" : "..."
}

For adding custom attributes, name field is required.

For editing a custom attribute, specify the custom attribute either by name:

{
  "name" : "...",
  "value" : "..."
}

Or by href:

{
  "href" : "http://localhost:3000/api/providers/:id/custom_attributes/:id",
  "value" : "..."
}

Custom Attribute Actions

Action Description

add

Adding Custom Attributes to a Provider

edit

Editing Custom Attributes of a Provider

delete

Deleting Custom Attributes from a Provider

Adding Provider Custom Attributes

Adding custom attributes to a Provider:

POST /api/providers/:id/custom_attributes
{
  "action" : "add",
  "resources" : [
    { ... },
    { ... },
    ...
  ]
}

For example, adding two custom attributes:

{
  "action" : "add",
  "resources" : [
    { "name" : "ca1", "value" : "value 1" },
    { "name" : "ca2", "value" : "value 2" }
  ]
}

Editing Provider Custom Attributes

Editing custom attributes of a Provider:

POST /api/providers/:id/custom_attributes
{
  "action" : "edit",
  "resources" : [
    { ... },
    { ... },
    ...
  ]
}

For example:

{
  "action" : "edit",
  "resources" : [
    { "name" : "ca_name1", "value" : "updated custom attribute value 1" },
    { "name" : "ca_name2", "value" : "updated custom attribute value 2" }
  ]
}

Deleting Provider Custom Attributes

Deleting custom attributes of a Provider:

POST /api/providers/:id/custom_attributes
{
  "action" : "delete",
  "resources" : [
    { ... },
    { ... },
    ...
  ]
}

In the following example, a request to delete custom attributes of a Provider by name and by href:

{
  "action" : "edit",
  "resources" : [
    { "name" : "ca_name1" },
    { "href" : "http://localhost:3000/api/providers/:id/custom_attributes/:id" }
  ]
}