OcapiConfigs resource (Data API 23.2)
Summary
Http Method | Resource | Description |
---|---|---|
GET | /ocapi_configs/{clientId} | Get all allowed resources for the client. |
PUT | /ocapi_configs/{clientId} | Add a client to existing OCAPI configurations. Overwrite config if the client already exists. |
POST | /ocapi_configs/{clientId} | Add a client to existing OCAPI configurations. Return errors when client already exists. |
DELETE | /ocapi_configs/{clientId} | Delete a client. |
Get all allowed resources for the client.
Get all allowed resources for the client.Url
GET https://hostname:port/dw/data/v23_2/ocapi_configs/{clientId}
Formats
json, xml
Authentication
Name | Description |
---|---|
OAuth | Authentication via OAuth token. A valid user is required. |
Response Document
Path Parameters
Parameter | Type | Description | Constraints |
---|---|---|---|
clientId | String | client ID | mandatory=true, minLength=1, nullable=false |
In case of a failure Fault Document is returned.
Faults
Status | Type | Arguments | Description |
---|---|---|---|
400 | InvalidOCAPIConfigException |
config (String) msg (String) |
Indicates that at least one of the existing configs can not be parsed |
Sample
REQUEST:
GET /s/-/dw/data/v23_2/ocapi_configs/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
# in case of success:
RESPONSE:
HTTP/1.1 200 OK
Expires: Thu, 01-Jan-1970 00:00:00 GMT
{
"_v" : "23.2",
"_type":"ocapi_config_api_response",
"global":[
{
"_type":"site_resource_info",
"site_configs":[
{
"_type":"resource_info",
"resource_type":"data",
"resources":[
{
"_type":"resource_object",
"methods":[
"get"
],
"read_attributes":"(**)",
"resource_id":"/sites",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/customers",
"write_attributes":"(**)"
}
]
},
{
"_type":"resource_info",
"resource_type":"shop",
"allowed_origins":[
"http://foo.example.org"
],
"resources":[
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/baskets",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"put"
],
"read_attributes":"(**)",
"resource_id":"/baskets/*/billing_address",
"write_attributes":"(**)"
}
]
}
]
}
],
"sites":[
{
"_type":"site_resource_info",
"site_id":"Sites-SiteGenesis-Site",
"site_configs":[
{
"_type":"resource_info",
"resource_type":"data",
"resources":[
{
"_type":"resource_object",
"methods":[
"get"
],
"read_attributes":"(**)",
"resource_id":"/sites",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/customers",
"write_attributes":"(**)"
}
]
},
{
"_type":"resource_info",
"resource_type":"shop",
"allowed_origins":[
"http://foo.example.org"
],
"resources":[
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/baskets",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"put"
],
"read_attributes":"(**)",
"resource_id":"/baskets/*/billing_address",
"write_attributes":"(**)"
}
]
}
]
},
{
"_type":"site_resource_info",
"site_id":"Sites-SiteGenesisGlobal-Site",
"site_configs":[
{
"_type":"resource_info",
"resource_type":"data",
"resources":[
{
"_type":"resource_object",
"methods":[
"get"
],
"read_attributes":"(**)",
"resource_id":"/sites",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/customers",
"write_attributes":"(**)"
}
]
},
{
"_type":"resource_info",
"resource_type":"shop",
"allowed_origins":[
"http://foo.example.org"
],
"resources":[
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/baskets",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"put"
],
"read_attributes":"(**)",
"resource_id":"/baskets/*/billing_address",
"write_attributes":"(**)"
}
]
}
]
}
]
}
# in case of failure when the configure is invalid
RESPONSE:
HTTP/1.1 400
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
{
"_v" : "23.2",
"fault": {
"arguments": {
"Config": "{\"_v\":\"23.2\",\"clients\":[{\"client_id\":\"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa\",\"resources\":[{\"cache_time\":86400,\"methods\":[\"get\",\"head\",\"options\"],\"read_attributes\":\"(-c_reCaptchaKeys,-c_ocapiClientIdsForHypeProducts,**)\",\"resource_id\":\"/products/{id}\",\"write_attributes\":\"(**)\"}]},{\"client_id\":\"bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\",\"resources\":[{\"methods\":[\"post\"],\"read_attributes\":\"(**)\",\"resource_id\":\"/unknown-resource\",\"write_attributes\":\"(**)\"}]}]}",
"ErrorMsg": "Unknown resource id provided. Please provide a valid resource id. Location: '$.clients[1].resources[0].resource_id'"
},
"type": "InvalidOCAPIConfigException",
"message": "Invalid OCAPI configuration '{\"_v\":\"23.2\",\"clients\":[{\"client_id\":\"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa\",\"resources\":[{\"cache_time\":86400,\"methods\":[\"get\",\"head\",\"options\"],\"read_attributes\":\"(-c_reCaptchaKeys,-c_ocapiClientIdsForHypeProducts,**)\",\"resource_id\":\"/products/{id}\",\"write_attributes\":\"(**)\"}]},{\"client_id\":\"bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\",\"resources\":[{\"methods\":[\"post\"],\"read_attributes\":\"(**)\",\"resource_id\":\"/unknown-resource\",\"write_attributes\":\"(**)\"}]}]}''"
}
}
Add a client to existing OCAPI configurations. Overwrite config if the client already exists.
Add a client to existing OCAPI configurations. Overwrite config if the client already exists.Url
PUT https://hostname:port/dw/data/v23_2/ocapi_configs/{clientId}
Formats
json, xml
Authentication
Name | Description |
---|---|
OAuth | Authentication via OAuth token. A valid user is required. |
Request Document
Response Document
Path Parameters
Parameter | Type | Description | Constraints |
---|---|---|---|
clientId | String | client ID | mandatory=true, minLength=1, nullable=false |
In case of a failure Fault Document is returned.
Faults
Status | Type | Arguments | Description |
---|---|---|---|
400 | InvalidOCAPIConfigException |
config (String) msg (String) |
Indicates that the resulting config is not valid |
400 | SelfUpdateException |
Write operation on self is not allowed. (The clientId being used for calling this API should be different from target clientId) | |
404 | SiteNotFoundException |
siteId (String) |
Indicates that at least one of the target sites is unknown |
Sample
REQUEST:
# Example 1: Add Shop API resources to Global
PUT /s/-/dw/data/v23_2/ocapi_configs/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
{
"resource_info":{
"allowed_origins":[
"http://foo.example.org"
],
"resource_type":"shop",
"resources":[
{
"_type":"resource_object",
"resource_id":"/baskets",
"methods":[
"post"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"resource_id":"/baskets/*/billing_address",
"methods":[
"put"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
}
]
}
}
# Example 2: Add Data API resources to Global
PUT /s/-/dw/data/v23_2/ocapi_configs/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
{
"resource_info":{
"resource_type":"data",
"resources":[
{
"resource_id":"/sites",
"methods":[
"get"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers",
"methods":[
"post"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
}
]
}
}
# Example 3: Add Shop API resources to Sites
PUT /s/-/dw/data/v23_2/ocapi_configs/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
{
"sites":[
"SiteGenesis",
"SiteGenesisGlobal"
],
"resource_info":{
"allowed_origins":[
"http://foo.example.org"
],
"resource_type":"shop",
"resources":[
{
"_type":"resource_object",
"resource_id":"/baskets",
"methods":[
"post"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"resource_id":"/baskets/*/billing_address",
"methods":[
"put"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
}
]
}
}
# Example 4: Add Data API resources to Sites
PUT /s/-/dw/data/v23_2/ocapi_configs/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
{
"sites":[
"SiteGenesis",
"SiteGenesisGlobal"
],
"resource_info":{
"resource_type":"data",
"resources":[
{
"resource_id":"/sites",
"methods":[
"get"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers",
"methods":[
"post"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
}
]
}
}
# in case of success:
RESPONSE:
HTTP/1.1 200 OK
Expires: Thu, 01-Jan-1970 00:00:00 GMT
{
"_v" : "23.2",
"_type":"ocapi_config_api_response",
"global":[
{
"_type":"site_resource_info",
"site_configs":[
{
"_type":"resource_info",
"resource_type":"data",
"resources":[
{
"_type":"resource_object",
"methods":[
"get"
],
"read_attributes":"(**)",
"resource_id":"/sites",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/customers",
"write_attributes":"(**)"
}
]
},
{
"_type":"resource_info",
"resource_type":"shop",
"allowed_origins":[
"http://foo.example.org"
],
"resources":[
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/baskets",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"put"
],
"read_attributes":"(**)",
"resource_id":"/baskets/*/billing_address",
"write_attributes":"(**)"
}
]
}
]
}
],
"sites":[
{
"_type":"site_resource_info",
"site_id":"Sites-SiteGenesis-Site",
"site_configs":[
{
"_type":"resource_info",
"resource_type":"data",
"resources":[
{
"_type":"resource_object",
"methods":[
"get"
],
"read_attributes":"(**)",
"resource_id":"/sites",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/customers",
"write_attributes":"(**)"
}
]
},
{
"_type":"resource_info",
"resource_type":"shop",
"allowed_origins":[
"http://foo.example.org"
],
"resources":[
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/baskets",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"put"
],
"read_attributes":"(**)",
"resource_id":"/baskets/*/billing_address",
"write_attributes":"(**)"
}
]
}
]
},
{
"_type":"site_resource_info",
"site_id":"Sites-SiteGenesisGlobal-Site",
"site_configs":[
{
"_type":"resource_info",
"resource_type":"data",
"resources":[
{
"_type":"resource_object",
"methods":[
"get"
],
"read_attributes":"(**)",
"resource_id":"/sites",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/customers",
"write_attributes":"(**)"
}
]
},
{
"_type":"resource_info",
"resource_type":"shop",
"allowed_origins":[
"http://foo.example.org"
],
"resources":[
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/baskets",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"put"
],
"read_attributes":"(**)",
"resource_id":"/baskets/*/billing_address",
"write_attributes":"(**)"
}
]
}
]
}
]
}
# in case of failure when sites are not found
RESPONSE:
HTTP/1.1 404
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
{
"_v" : "23.2",
"fault": {
"arguments": {
"siteId": "UnknownSite"
},
"type": "SiteNotFoundException",
"message": "No site with ID 'UnknownSite' was found."
}
}
# in case of failure when the configure is invalid
RESPONSE:
HTTP/1.1 400
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
{
"_v" : "23.2",
"fault": {
"arguments": {
"Config": "{\"_v\":\"23.2\",\"clients\":[{\"client_id\":\"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa\",\"resources\":[{\"cache_time\":86400,\"methods\":[\"get\",\"head\",\"options\"],\"read_attributes\":\"(-c_reCaptchaKeys,-c_ocapiClientIdsForHypeProducts,**)\",\"resource_id\":\"/products/{id}\",\"write_attributes\":\"(**)\"}]},{\"client_id\":\"bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\",\"resources\":[{\"methods\":[\"post\"],\"read_attributes\":\"(**)\",\"resource_id\":\"/unknown-resource\",\"write_attributes\":\"(**)\"}]}]}",
"ErrorMsg": "Unknown resource id provided. Please provide a valid resource id. Location: '$.clients[1].resources[0].resource_id'"
},
"type": "InvalidOCAPIConfigException",
"message": "Invalid OCAPI configuration '{\"_v\":\"23.2\",\"clients\":[{\"client_id\":\"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa\",\"resources\":[{\"cache_time\":86400,\"methods\":[\"get\",\"head\",\"options\"],\"read_attributes\":\"(-c_reCaptchaKeys,-c_ocapiClientIdsForHypeProducts,**)\",\"resource_id\":\"/products/{id}\",\"write_attributes\":\"(**)\"}]},{\"client_id\":\"bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\",\"resources\":[{\"methods\":[\"post\"],\"read_attributes\":\"(**)\",\"resource_id\":\"/unknown-resource\",\"write_attributes\":\"(**)\"}]}]}''"
}
}
# in case of failure when a client is trying to update itself. (the clientId being used for calling this API is the same as the target clientId)
RESPONSE:
HTTP/1.1 400
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
{
"_v" : "23.2",
"fault": {
"type": "SelfUpdateException",
"message": "Write operation on self is not allowed. "
}
}
Add a client to existing OCAPI configurations. Return errors when client already exists.
Add a client to existing OCAPI configurations. Return errors when client already exists.Url
POST https://hostname:port/dw/data/v23_2/ocapi_configs/{clientId}
Formats
json, xml
Authentication
Name | Description |
---|---|
OAuth | Authentication via OAuth token. A valid user is required. |
Request Document
Response Document
Path Parameters
Parameter | Type | Description | Constraints |
---|---|---|---|
clientId | String | client ID | mandatory=true, minLength=1, nullable=false |
In case of a failure Fault Document is returned.
Faults
Status | Type | Arguments | Description |
---|---|---|---|
400 | InvalidOCAPIConfigException |
config (String) msg (String) |
Indicates that the resulting config is not valid |
400 | SelfUpdateException |
Write operation on self is not allowed. (The clientId being used for calling this API should be different from target clientId) | |
404 | SiteNotFoundException |
siteId (String) |
Indicates that at least one of the target sites is unknown |
409 | DuplicateClientIdException |
clientId (String) |
Indicates that the client id already exists in original OCAPI configuration |
Sample
REQUEST:
# Example 1: Add Shop API resources to Global
POST /s/-/dw/data/v23_2/ocapi_configs/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
{
"resource_info":{
"allowed_origins":[
"http://foo.example.org"
],
"resource_type":"shop",
"resources":[
{
"_type":"resource_object",
"resource_id":"/baskets",
"methods":[
"post"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"resource_id":"/baskets/*/billing_address",
"methods":[
"put"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
}
]
}
}
# Example 2: Add Data API resources to Global
POST /s/-/dw/data/v23_2/ocapi_configs/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
{
"resource_info":{
"resource_type":"data",
"resources":[
{
"resource_id":"/sites",
"methods":[
"get"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers",
"methods":[
"post"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
}
]
}
}
# Example 3: Add Shop API resources to Sites
POST /s/-/dw/data/v23_2/ocapi_configs/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
{
"sites":[
"SiteGenesis",
"SiteGenesisGlobal"
],
"resource_info":{
"allowed_origins":[
"http://foo.example.org"
],
"resource_type":"shop",
"resources":[
{
"_type":"resource_object",
"resource_id":"/baskets",
"methods":[
"post"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"resource_id":"/baskets/*/billing_address",
"methods":[
"put"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
}
]
}
}
# Example 4: Add Data API resources to Sites
POST /s/-/dw/data/v23_2/ocapi_configs/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
{
"sites":[
"SiteGenesis",
"SiteGenesisGlobal"
],
"resource_info":{
"resource_type":"data",
"resources":[
{
"resource_id":"/sites",
"methods":[
"get"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
},
{
"resource_id":"/customers",
"methods":[
"post"
],
"read_attributes":"(**)",
"write_attributes":"(**)"
}
]
}
}
# in case of success:
RESPONSE:
HTTP/1.1 200 OK
Expires: Thu, 01-Jan-1970 00:00:00 GMT
{
"_v" : "23.2",
"_type":"ocapi_config_api_response",
"global":[
{
"_type":"site_resource_info",
"site_configs":[
{
"_type":"resource_info",
"resource_type":"data",
"resources":[
{
"_type":"resource_object",
"methods":[
"get"
],
"read_attributes":"(**)",
"resource_id":"/sites",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/customers",
"write_attributes":"(**)"
}
]
},
{
"_type":"resource_info",
"resource_type":"shop",
"allowed_origins":[
"http://foo.example.org"
],
"resources":[
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/baskets",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"put"
],
"read_attributes":"(**)",
"resource_id":"/baskets/*/billing_address",
"write_attributes":"(**)"
}
]
}
]
}
],
"sites":[
{
"_type":"site_resource_info",
"site_id":"Sites-SiteGenesis-Site",
"site_configs":[
{
"_type":"resource_info",
"resource_type":"data",
"resources":[
{
"_type":"resource_object",
"methods":[
"get"
],
"read_attributes":"(**)",
"resource_id":"/sites",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/customers",
"write_attributes":"(**)"
}
]
},
{
"_type":"resource_info",
"resource_type":"shop",
"allowed_origins":[
"http://foo.example.org"
],
"resources":[
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/baskets",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"put"
],
"read_attributes":"(**)",
"resource_id":"/baskets/*/billing_address",
"write_attributes":"(**)"
}
]
}
]
},
{
"_type":"site_resource_info",
"site_id":"Sites-SiteGenesisGlobal-Site",
"site_configs":[
{
"_type":"resource_info",
"resource_type":"data",
"resources":[
{
"_type":"resource_object",
"methods":[
"get"
],
"read_attributes":"(**)",
"resource_id":"/sites",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/customers",
"write_attributes":"(**)"
}
]
},
{
"_type":"resource_info",
"resource_type":"shop",
"allowed_origins":[
"http://foo.example.org"
],
"resources":[
{
"_type":"resource_object",
"methods":[
"post"
],
"read_attributes":"(**)",
"resource_id":"/baskets",
"write_attributes":"(**)"
},
{
"_type":"resource_object",
"methods":[
"put"
],
"read_attributes":"(**)",
"resource_id":"/baskets/*/billing_address",
"write_attributes":"(**)"
}
]
}
]
}
]
}
# in case of failure when sites are not found
RESPONSE:
HTTP/1.1 404
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
{
"_v" : "23.2",
"fault": {
"arguments": {
"siteId": "UnknownSite"
},
"type": "SiteNotFoundException",
"message": "No site with ID 'UnknownSite' was found."
}
}
# in case of failure when the client id has already existed
RESPONSE:
HTTP/1.1 409
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
{
"_v" : "23.2",
"fault": {
"arguments": {
"clientId": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"
},
"type": "DuplicateClientIdException",
"message": "Client Id 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb' is duplicate."
}
}
# in case of failure when the configure is invalid
RESPONSE:
HTTP/1.1 400
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
{
"_v" : "23.2",
"fault": {
"arguments": {
"Config": "{\"_v\":\"23.2\",\"clients\":[{\"client_id\":\"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa\",\"resources\":[{\"cache_time\":86400,\"methods\":[\"get\",\"head\",\"options\"],\"read_attributes\":\"(-c_reCaptchaKeys,-c_ocapiClientIdsForHypeProducts,**)\",\"resource_id\":\"/products/{id}\",\"write_attributes\":\"(**)\"}]},{\"client_id\":\"bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\",\"resources\":[{\"methods\":[\"post\"],\"read_attributes\":\"(**)\",\"resource_id\":\"/unknown-resource\",\"write_attributes\":\"(**)\"}]}]}",
"ErrorMsg": "Unknown resource id provided. Please provide a valid resource id. Location: '$.clients[1].resources[0].resource_id'"
},
"type": "InvalidOCAPIConfigException",
"message": "Invalid OCAPI configuration '{\"_v\":\"23.2\",\"clients\":[{\"client_id\":\"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa\",\"resources\":[{\"cache_time\":86400,\"methods\":[\"get\",\"head\",\"options\"],\"read_attributes\":\"(-c_reCaptchaKeys,-c_ocapiClientIdsForHypeProducts,**)\",\"resource_id\":\"/products/{id}\",\"write_attributes\":\"(**)\"}]},{\"client_id\":\"bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\",\"resources\":[{\"methods\":[\"post\"],\"read_attributes\":\"(**)\",\"resource_id\":\"/unknown-resource\",\"write_attributes\":\"(**)\"}]}]}''"
}
}
# in case of failure when a client is trying to update itself. (the clientId being used for calling this API is the same as the target clientId)
RESPONSE:
HTTP/1.1 400
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
{
"_v" : "23.2",
"fault": {
"type": "SelfUpdateException",
"message": "Write operation on self is not allowed. "
}
}
Delete a client.
Delete a client.Url
DELETE https://hostname:port/dw/data/v23_2/ocapi_configs/{clientId}
Formats
json, xml
Authentication
Name | Description |
---|---|
OAuth | Authentication via OAuth token. A valid user is required. |
Path Parameters
Parameter | Type | Description | Constraints |
---|---|---|---|
clientId | String | Id of the client to be deleted. | mandatory=true, minLength=1, nullable=false |
In case of a failure Fault Document is returned.
Faults
Status | Type | Arguments | Description |
---|---|---|---|
400 | InvalidOCAPIConfigException |
config (String) msg (String) |
Indicates that the resulting config is not valid |
400 | SelfUpdateException |
Write operation on self is not allowed. (The clientId being used for calling this API should be different from target clientId) |
Sample
REQUEST:
DELETE /s/-/dw/data/v23_2/ocapi_configs/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
# in case of success:
RESPONSE:
HTTP/1.1 204 OK
# in case of failure when a client is trying to delete itself. (the clientId being used for calling this API is the same as the target clientId)
RESPONSE:
HTTP/1.1 400
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
{
"_v" : "23.2",
"fault": {
"type": "SelfUpdateException",
"message": "Write operation on self is not allowed. "
}
}
X
OCAPI versions 15.x and 16.x will be retired on March 31, 2021. For dates and more information, see the OCAPI versioning and deprecation policy and this Knowledge Article.