Webservice
CMF has a built-in REST webservice. It authenticates requests with API keys, which you configure for Pimcore users in Pimcore Studio.
Add the API key as an X-API-Key HTTP header (recommended) or an apikey URL parameter on your request.
The webservice also supports session authentication: if the request carries a valid Pimcore Studio user session (for
example when testing in the browser), you do not need to add the X-API-Key header or the apikey parameter.
Configure the Symfony firewall in your security.yml; see the
Installation chapter for details.
API Reference
Customers API
Standard REST calls for customer CRUD actions:
| Path | Method | Description |
|---|---|---|
| /__customermanagementframework/webservice/customers | GET | Fetch all customers |
| /__customermanagementframework/webservice/customers/{id} | GET | Fetch a single customer |
| /__customermanagementframework/webservice/customers | PUT, POST | Create a new customer |
| /__customermanagementframework/webservice/customers/{id} | PUT, POST | Update a customer |
| /__customermanagementframework/webservice/customers/{id} | DELETE | Delete a customer |
Filter GET requests with these query parameters:
| Parameter | Possible Values | Description |
|---|---|---|
| includeActivities | true/false | include the customer's activities in the result set |
| segments | repeated segments[] params | filter by segments, one parameter per segment ID |
| page | int | page number for paging |
| pageSize | int | page size for paging |
| modificationTimestamp | int | filter for customers with a newer modification timestamp |
Pass one segments[] parameter per segment ID. The endpoint does not split comma-separated values, and a scalar
segments=1 is rejected with HTTP 400:
GET /__customermanagementframework/webservice/customers?segments[]=1&segments[]=2&includeActivities=true
Activities API
Standard REST calls for activity CRUD actions:
| Path | Method | Description |
|---|---|---|
| /__customermanagementframework/webservice/activities | GET | Fetch all activities |
| /__customermanagementframework/webservice/activities/{id} | GET | Fetch a single activity |
| /__customermanagementframework/webservice/activities | PUT, POST | Create a new activity |
| /__customermanagementframework/webservice/activities/{id} | PUT, POST | Update an activity |
| /__customermanagementframework/webservice/activities/{id} | DELETE | Delete an activity |
Filter GET requests with these query parameters:
| Parameter | Possible Values | Description |
|---|---|---|
| type | string | filter by activity type |
| modifiedSinceTimestamp | timestamp/int | get activities modified since the given timestamp |
| page | int | page number for paging |
| pageSize | int | page size for paging |
Deletions API
Delivers information about deletions of customers and activities:
| Path | Method | Description |
|---|---|---|
| /__customermanagementframework/webservice/deletions | GET | Fetch recorded deletions |
Query parameters:
| Parameter | Possible Values | Required | Description |
|---|---|---|---|
| entityType | customers/activities | yes | get deletions of customers or activities |
| deletionsSinceTimestamp | timestamp/int | no | get deletions recorded since the given timestamp |
The request fails with an error if entityType is missing.
Segments API
Standard REST calls for customer segment CRUD actions:
| Path | Method | Description |
|---|---|---|
| /__customermanagementframework/webservice/segments | GET | Fetch all segments |
| /__customermanagementframework/webservice/segments/{id} | GET | Fetch a single segment |
| /__customermanagementframework/webservice/segments | PUT, POST | Create a new segment |
| /__customermanagementframework/webservice/segments/{id} | PUT, POST | Update a segment |
| /__customermanagementframework/webservice/segments/{id} | DELETE | Delete a segment |
Filter GET requests with these query parameters:
| Parameter | Possible Values | Description |
|---|---|---|
| page | int | page number for paging |
| pageSize | int | page size for paging |
Segment Groups API
Standard REST calls for customer segment group CRUD actions:
| Path | Method | Description |
|---|---|---|
| /__customermanagementframework/webservice/segment-groups | GET | Fetch all segment groups |
| /__customermanagementframework/webservice/segment-groups/{id} | GET | Fetch a single segment group |
| /__customermanagementframework/webservice/segment-groups | PUT, POST | Create a new segment group |
| /__customermanagementframework/webservice/segment-groups/{id} | PUT, POST | Update a segment group |
| /__customermanagementframework/webservice/segment-groups/{id} | DELETE | Delete a segment group |
Filter GET requests with these query parameters:
| Parameter | Possible Values | Description |
|---|---|---|
| page | int | page number for paging |
| pageSize | int | page size for paging |
Segments of Customers API
Adds and removes segments from a customer:
| Path | Method | Description |
|---|---|---|
| /__customermanagementframework/webservice/segments-of-customers | PUT, POST | Add and/or remove segments |
Example request body JSON:
{
"customerId": 12345,
"addSegments": [123,456],
"removeSegments": [567,789]
}
