Add posting to basket
This endpoint is deprecated. Please do not use it for new projects. The documentation remains here for legacy API consumers.
Adding a job to the basket
By issuing a PUT-request with the /jobs/basket/{jobDbId} endpoint, a job can be added to the basket. There are 2 use cases:
Request with tokens
- A non-logged id user adds a job to the basket. The jobDbIds are stored in a cookie.
1curl -i -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" -X PUT "https://api.softgarden.io/api/rest/v2/frontend/jobs/basket/{jobDbId}?cookie={cookie}"
with TOKEN being a client access token. {cookie} must be set to the client’s cookie ID, for example ‘123456’ and the {jobDbId} corresponds to the job that is to be added. - A logged in user adds a job to the basket. The jobDbIds in his basket are stored in the database. When he had jobs in his basket before login, those can be merged into his current basket.
1curl -i -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" -X PUT "https://api.softgarden.io/api/rest/v2/frontend/jobs/basket/{jobDbId}"
with TOKEN being a client access token. The {jobDbId} corresponds to the job that is to be added, a {cookie} is not needed here.
Request with basic authorization
As an alternative, you can use here the basic authorization method. Just write
1 |
curl -i -u "{clientId}:" -H "Content-Type: application/json" -X PUT "https://api.softgarden.io/api/rest/v2/frontend/jobs/basket/{jobDbId}?cookie={cookie}" |
respectively for the second use case:
1 |
curl -i -u "{clientId}:" -H "Content-Type: application/json" -X PUT "https://api.softgarden.io/api/rest/v2/frontend/jobs/basket/{jobDbId}" |
{clientId} is the ID for your application to develop given to you by softgarden. The colon seen in the example is obligatory.
In both cases no feedback is given, void is returned.
Path parameters
Name | Description | Data Type |
---|---|---|
jobDbId | The ID of the job to be added to the basket. | long |
Query parameters
Name | Description | Data Type |
---|---|---|
cookie | The client’s cookie ID. See also this page. | String |
Response values
Upon | Returned value | Description |
---|---|---|
failure | 500 – INTERNAL SERVER ERROR | When an error appears while processing your request. |
authorization error | 401 / 403 | See here for details. |