PUT suppliers/{supplier}

Updates the specified supplier information.

Only suppliers that were created with the REST API can be updated with this request.

Path

/api/%API_VERSION%/suppliers/{supplier}

Method

PUT

Request headers

This request has the following headers.

Request headers

Name

Value

Description

Authorization

string (base 64)

Authentication string.

Accept

application/json

Response content type.

Content-Type

application/json

Request content type.

You can also specify the utf-8 charset type. Example: Content-Type: application/json; charset=utf-8

Content-Length

integer

Request body size, in bytes.

The maximum body size for this request is 128 MB (134217728).

Request parameters

This request has the following parameters:

Request parameters

Name

Parameter type

Description

supplier

Path

Name of the supplier.

Request body

This request body contains a JSON array with a supplier object. Only one supplier object must be specified.

[

{

"name":"%SUPPLIER_NAME%",

"status":"%SUPPLIER_STATUS%,

"confidence": %SUPPLIER_CONFIDENCE%,

"retention": %SUPPLIER_RETENTION%,

"vendor": "%SUPPLIER_VENDOR%"

}

]

Supplier object properties are described in the following table.

Supplier object properties

Property

Value

Mandatory

Description

name

string

No

Name of the supplier.

status

string

No

Status of the supplier.

This value must be enabled if the supplier is to be enabled.

This value must be disabled if the supplier is to be disabled.

confidence

integer

No

Confidence level for indicators from this supplier.

retention

integer

No

Retention period for indicators, in minutes.

This parameter determines the period after which indicators from this supplier are not used in matching.

vendor

string

No

Supplier vendor name.

Request example

The following is an example of a PUT suppliers/{supplier} request.

PUT https://192.0.2.57/api/1.1/suppliers/ExampleSupplier

Accept: application/json

Content-Type: application/json

Authorization: Basic dXNlcjpwYXNzd29yZA==

Content-Length: 41

 

[

{"name":"NewName", "confidence": 90}

]

Response headers

The response has the following headers.

Response headers

Name

Value

Description

Content-Type

application/json

Response content type.

Content-Length

integer

Response body size, in bytes.

Response body

The response body contains a JSON object with a status of the operation.

[

{

"status": "Supplier info successfully updated"

}

]

Status object properties are described in the following table.

Status object properties

Property

Value

Description

status

string

Status of the operation.

Response example

The following is an example of a PUT suppliers/{supplier} request response.

НТТР/1.1 201 ОК

Date:Mon, 23 Dec 2019 09:56:10 UTC

Content-Type: application/json

Content-Length: 46

[{"status": "Supplier info successfully updated"}]

Error responses

For more information about possible response statuses, see section "Response statuses".

An error response contains a JSON array with the error description.

[

{

"status": "An error occurred while updating Supplier info",

"reason": "%REASON%"

}

]

Error object properties are described in the following table.

Error object properties

Property

Value

Description

status

string

Error description.

reason

string

Cause of the error.

Error response example

The following is an example of a PUT suppliers/{supplier} error response.

НТТР/1.1 404 Supplier doesn't exist

Date:Mon, 23 Dec 2019 09:56:10 UTC

Content-Type: application/json

Content-Length: 93

 

[{"status": "An error occurred while updating supplier info", "reason": "Supplier doesn't exist"}]

Page top