SourceCodeGroups resource (Data API 23.2)
Summary
Http Method | Resource | Description |
---|---|---|
GET | /sites/{site_id}/source_code_groups | Action to get all the source code groups with no filtering. |
GET | /sites/{site_id}/source_code_groups/{id} | Action to retrieve source code group information. |
PATCH | /sites/{site_id}/source_code_groups/{id} |
Updates the source code group with the specified information. |
DELETE | /sites/{site_id}/source_code_groups/{id} | Deletes the source code group by ID |
PUT | /sites/{site_id}/source_code_groups/{id} | Creates a source code group using the information provided. |
Get Source Code Groups
Action to get all the source code groups with no filtering.Url
GET https://hostname:port/dw/data/v23_2/sites/{site_id}/source_code_groups?start={Integer}&count={Integer}&select={String}&expand={String}
Formats
json, xml
Authentication
Name | Description |
---|---|
OAuth | Authentication via OAuth token. |
Response Document
Path Parameters
Parameter | Type | Description | Constraints |
---|---|---|---|
site_id | String | minLength=1 |
Query Parameters
Parameter | Type | Description | Constraints |
---|---|---|---|
count | Integer | Optional count for retrieving only a subset of the items (default is 25). | |
expand | String | ||
select | String | The property selector. | |
start | Integer | Optional start index for retrieving the items from a given index (default 0). |
Sample
REQUEST:
GET /s/-/dw/data/v23_2/sites/SiteGenesis/sourcecodegroups?select=(**)&expand=specifications HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
# in case of success:
RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8
{
"_v" : "23.2",
"count" : 2,
"data" : [
{
"_v" : "23.2",
"_type" : "source_code_group",
"active" : true,
"active_redirect" :
{
"_type" : "source_code_redirect_info",
"location_type" : "default"
},
"cookie_duration" : 7,
"description" : "my source code group description",
"enabled" : true,
"end_time" : "2034-11-15T00:00:00.000Z",
"id" : "my-sourcecodegroup",
"inactive_redirect" :
{
"_type" : "source_code_redirect_info",
"location_type" : "default"
},
"link" : "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/source_code_groups/my-sourcecodegroup",
"specifications" :
[
{
"_type" : "source_code_specification",
"expression" : "wsc4"
},
{
"_type" : "source_code_specification",
"expression" : "wsc4?"
}
],
"start_time" : "2014-11-15T00:00:00.000Z"
},
{
"_v" : "23.2",
"_type" : "source_code_group",
"active" : true,
"active_redirect" :
{
"_type" : "source_code_redirect_info",
"location_type" : "default"
},
"cookie_duration" : 7,
"description" : "my source code group description",
"enabled" : true,
"end_time" : "2034-11-15T00:00:00.000Z",
"id" : "my-sourcecodegroup",
"inactive_redirect" :
{
"_type" : "source_code_redirect_info",
"location_type" : "default"
},
"link" : "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/source_code_groups/my-sourcecodegroup",
"specifications" :
[
{
"_type" : "source_code_specification",
"expression" : "wsc4"
},
{
"_type" : "source_code_specification",
"expression" : "wsc4?"
}
],
"start_time" : "2014-11-15T00:00:00.000Z"
}
],
"select": "**",
"start" : 0,
"total" : 2
}
Get Source Code Group
Action to retrieve source code group information.Url
GET https://hostname:port/dw/data/v23_2/sites/{site_id}/source_code_groups/{id}?expand={String}
Formats
json, xml
Authentication
Name | Description |
---|---|
OAuth | Authentication via OAuth token. |
Response Document
Path Parameters
Parameter | Type | Description | Constraints |
---|---|---|---|
id | String | The id of the requested source code group. | maxLength=28, minLength=1 |
site_id | String | The id of the site. | minLength=1 |
Query Parameters
Parameter | Type | Description | Constraints |
---|---|---|---|
expand | String | the query parameter takes an expansion list to include extra information, such as specifications. usage: expand=specifications. |
In case of a failure Fault Document is returned.
Faults
Status | Type | Arguments | Description |
---|---|---|---|
404 | SourceCodeGroupNotFoundException |
sourcecodegroupId (String) siteId (String) |
Thrown in case the source code group does not exist matching the given id |
Sample
REQUEST:
GET /s/-/dw/data/v23_2/sites/SiteGenesis/source_code_groups/my-sourcecodegroup?select=(**)&expand=specifications HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
# in case of success:
RESPONSE:
HTTP/1.1 200 OK
Expires: Thu, 01-Aug-2014 00:00:00 GMT
x-dw-resource-state: 43c2d7a118bd0a4034399ed86c86654b40c198ea64fd3195e5587d9211d10d7e
{
"_v" : "23.2",
"_type" : "source_code_group",
"active" : true,
"active_redirect" :
{
"_type" : "source_code_redirect_info",
"location_type" : "default"
},
"cookie_duration" : 7,
"description" : "my source code group description",
"enabled" : true,
"end_time" : "2034-11-15T00:00:00.000Z",
"id" : "my-sourcecodegroup",
"inactive_redirect" :
{
"_type" : "source_code_redirect_info",
"location_type" : "default"
},
"link" : "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/source_code_groups/my-sourcecodegroup",
"specifications" :
[
{
"_type" : "source_code_specification",
"expression" : "wsc4"
},
{
"_type" : "source_code_specification",
"expression" : "wsc4?"
}
],
"start_time" : "2014-11-15T00:00:00.000Z"
}
# in case of failure:
RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
"_v" : "23.2",
"fault":{
"type":"SourceCodeGroupNotFoundException",
"message":"No source code group with ID 'my-sourcecodegroup' was found."
}
}
Update Source Code Group
Updates the source code group with the specified information.
Url
PATCH https://hostname:port/dw/data/v23_2/sites/{site_id}/source_code_groups/{id}
Formats
json, xml
Authentication
Name | Description |
---|---|
OAuth | Authentication via OAuth token. |
Request Document
Response Document
Path Parameters
Parameter | Type | Description | Constraints |
---|---|---|---|
id | String | The id of the requested source code group. | maxLength=28, minLength=1 |
site_id | String | The id of the site. | minLength=1 |
In case of a failure Fault Document is returned.
Faults
Status | Type | Arguments | Description |
---|---|---|---|
404 | SourceCodeGroupNotFoundException |
sourcecodegroupId (String) siteId (String) |
Thrown in case the source code group does not exist matching the given id |
Sample
REQUEST:
PATCH /s/-/dw/data/v23_2/sites/SiteGenesis/source_code_groups/my-sourcecodegroup HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
x-dw-resource-state: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5
{
"id": "my-sourcecodegroup",
"description": "description for my source code group",
"start_time": "2014-10-01T00:00:00.000Z",
"end_time": "2030-10-01T00:00:00.000Z",
"enabled": true,
"active_redirect": { location_type:"product", location:"SimpleProduct"},
"inactive_redirect": { location_type:"page", location:"inactive-source-code"},
"cookie_duration": 5
}
# in case of success:
RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8
x-dw-resource-state: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5
{
"_v" : "23.2",
"_type" : "source_code_group",
"active" : true,
"active_redirect" :
{
"_type" : "source_code_redirect_info",
"location" : "SimpleProduct",
"location_type" : "product"
},
"cookie_duration" : 5,
"description" : "description for my source code group",
"enabled" : true,
"end_time" : "2030-10-01T00:00:00.000Z",
"id" : "my-sourcecodegroup",
"inactive_redirect" :
{
"_type" : "source_code_redirect_info",
"location" : "inactive-source-code",
"location_type" : "page"
},
"link" : "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/source_code_groups/my-sourcecodegroup",
"start_time" : "2014-10-01T00:00:00.000Z"
}
# in case of failure:
RESPONSE:
HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
"_v" : "23.2",
"fault":{
"type":"SourceCodeGroupNotFoundException",
"message":"No source code group with ID 'my-sourcecodegroup' was found."
}
}
Delete SourceCodeGroup
Deletes the source code group by IDUrl
DELETE https://hostname:port/dw/data/v23_2/sites/{site_id}/source_code_groups/{id}
Formats
json, xml
Authentication
Name | Description |
---|---|
OAuth | Authentication via OAuth token. |
Path Parameters
Parameter | Type | Description | Constraints |
---|---|---|---|
id | String | One source code group id to remove | maxLength=28, minLength=1 |
site_id | String | The id of the site. | minLength=1 |
Sample
REQUEST:
DELETE /s/-/dw/data/v23_2/sites/SiteGenesis/source_code_groups/my-sourcecodegroup HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
# in case of success:
RESPONSE:
HTTP/1.1 204 No Content
# in case of failure:
RESPONSE:
{
"_v" : "23.2",
"fault" :
{
"type" : "SiteNotFoundException",
"message" : "No site with ID 'SiteGenesisβ was found."
}
}
Create SourceCodeGroup
Creates a source code group using the information provided.Url
PUT https://hostname:port/dw/data/v23_2/sites/{site_id}/source_code_groups/{id}
Formats
json, xml
Authentication
Name | Description |
---|---|
OAuth | Authentication via OAuth token. |
Request Document
Response Document
Path Parameters
Parameter | Type | Description | Constraints |
---|---|---|---|
id | String | The id of the source code group to create. | maxLength=28, minLength=1 |
site_id | String | The id of the site. | minLength=1 |
In case of a failure Fault Document is returned.
Faults
Status | Type | Arguments | Description |
---|---|---|---|
400 | SourceCodeGroupInvalidException |
sourcecodegroupId (String) fieldId (String) |
if the source code group passed in is not valid (the argument indicates the field that was invalid). |
400 | IdConflictException |
bodyID (String) urlID (String) |
Thrown when the id given in request URL is different from the id provided in the source code group document |
Sample
REQUEST:
PUT /s/-/dw/data/v23_2/sites/SiteGenesis/source_code_groups/my-sourcecodegroup HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
{
"description": "description for source code group test_sourcecodegroup_1439497909526",
"start_time": "2014-10-01T00:00:00.000Z",
"end_time": "2030-10-01T00:00:00.000Z",
"enabled": true,
"active_redirect": { location_type:"product", location:"SimpleProduct"},
"inactive_redirect": { location_type:"page", location:"inactive-source-code"},
"cookie_duration": 5
}
# in case of success:
RESPONSE:
HTTP/1.1 201 CREATED
Location: https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/source_code_groups/my-sourcecodegroup
Content-Length: 67
Content-Type: application/json; charset=UTF-8
x-dw-resource-state: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5
{
"_v" : "23.2",
"_type" : "source_code_group",
"active" : true,
"active_redirect" :
{
"_type" : "source_code_redirect_info",
"location" : "SimpleProduct",
"location_type" : "product"
},
"cookie_duration" : 5,
"description" : "description for source code group my source code group",
"enabled" : true,
"end_time" : "2030-10-01T00:00:00.000Z",
"id" : "my-sourcecodegroup",
"inactive_redirect" :
{
"_type" : "source_code_redirect_info",
"location" : "inactive-source-code",
"location_type" : "page"
},
"link" : "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/source_code_groups/my-sourcecodegroup",
"start_time" : "2014-10-01T00:00:00.000Z"
}
# in case of failure:
RESPONSE:
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
"_v" : "23.2",
"fault":{
"type":"SourceCodeGroupCreateException",
"message":"Could not create source code group with ID 'my-sourcecodegroup'."
}
}