.. index:: User, UserFeatures .. _user_advertisements: User advertisements =================== Collection of :ref:`advertisement ` representations. Returning advertisements of the user. The requested advertisements will be returned as embedded resources. .. note:: The embeded advertisements do not contain attribute values at this moment Query Parameters ---------------- .. parameters:: .. parameter:: :name: offset :constraints: -- :default: 0 0 based index of the first element to return in the response, currently has to be a multiple of the limit value eg. when the limit is 10, then 10, 20, 30 are allowed 11 is not .. parameter:: :name: limit :constraints: -- :default: 100 maximum number of contained elements to return in the response Relations --------- .. relations:: .. relation:: :name: mp:advertisement :embedded: yes :cardinality: 0..N Reference --------- .. endpoint:: GET /v1/users/{userId}/advertisements Get all the advertisement of the user. Note that this only works on the logged in user. Defaults to offset 0 and limit 100. .. endpoint:: GET /v1/users/{userId}/advertisements?offset={offset}&limit={limit} Get all the advertisement of the user. Note that this only works on the logged in user. You can supply your own offset an limit. The offset is the number of ads that should be skipped, the limit is the max amount of advertisements that you want to return. The limit cannot be greater than 100. In order for pagination to work, the offset should be a multitude of the limit. For example: .. code-block:: http valid offsets offset 0, limit 10 offset 10, limit 10 offset 100, limit 10 offset 12, limit 6 .. code-block:: http invalid offsets offset 2, limit 10 offset 8, limit 10 offset -1, limit 10 offset 5, limit 6 You will receive a 400 response with pagination-invalid if you supply an offset and limit that we cannot support. Errors ------ .. errors:: .. error:: :http: 401 :code: unauthorized :description: The userId is not of the currently logged in user .. error:: :http: 400 :code: pagination-invalid :description: The pagination offset and limit need to match, offset should be a multitude of limit. Examples -------- .. include:: examples/get-user-advertisements-example.rst