(Quick Reference)
Service: Authentication
URL:
https://BASE_URL/j_spring_security_check
Method: POST
Parameters:
Name | Description | Type | Required | Possible values |
---|
j_username | email | String | yes | |
j_password | password | String | yes | |
ajax | | String | yes | true |
Description:
If you want to connect to valomnia REST API, you will need to use Cookie-based Authentication.
You will get the session cookie (in the header of the response) from the server, which you can use in subsequent requests. You can see an example of this below. You'll notice that the cookie name and value are the same as the cookie name and value in the session response above.
Set-Cookie: JSESSIONID=6E3487971234567896704A9EB4AE501F; Path=/; HttpOnly
Now that you've created a session, it's just a matter of setting the cookie in all subsequent requests to the server.
Example:
$ curl -H Cookie:JSESSIONID=6E3487971234567896704A9EB4AE501F https://BASE_URL/api/v1.0/orders
Success Output
If authentication was successful, it might redirect to https://BASE_URL/login/ajaxSuccess with a 302 code, that returns user and organization details in JSON format.
{
"warning": {
"warning_code": "deprecated_version",
"warning_description": "All versions older than 1.0 version are deprecated and will be removed in the next release"
},
"success": true,
"token": "6E3487971234567896704A9EB4AE501F",
"user": {
"firstName": "Jane",
"lastName": "Doe",
"email": "foobar@example.com",
"address": null,
"city": null,
"country": null,
"postalCode": null,
"gender": null,
"phone": null,
"job": null,
"avatar": "1455115600210_1448038178_supportfemale.png",
"birthday": null,
"companyName": "entity1",
"companyDescription": null,
"companyPhone": null,
"companyFax": null,
"companyEmail": "foobar@example.com",
"companyWebSite": null,
"companyAddress": null,
"companyPostalCode": null,
"companyCity": "Sousse",
"companyCountry": "TN",
"isGeoLocationActivated": true,
"enableCheckStock": true,
"enableAssignRegionToCustomer": true,
"role": [
"ROLE_USER"
],
"enabled": true,
"homeBackground": null,
"organizationLogo": "/entity1-1450169988465/photoOrganization/***_1450349861417_valomnialogo.png",
"applicationColor": "#00567a",
"buttonsColor": "#a92c26",
"uploadDirectory": "/entity1-1450169988465",
"currency": {
"name": "EUR",
"symbol": "€",
"symbolLocation": "RIGHT",
"digitNumber": 2
},
"pricePrecedence": "HIGHEST",
"promotionPrecedence": "HIGHEST",
"taxPrecedence": "HIGHEST",
"emailCommand": "",
"emailCommandAddresses": [],
"termsOfSale": "",
"dueDiligence": "",
"checkInType": "BARR_CODE",
"uuid": null,
"appVersion": null,
"videoUploadLimit": 1073741824,
"companyRegistrationNumber": null,
"formattedVideoUploadLimit": "1,0 Go",
"totalUpload": 44045072,
"formattedTotalUpload": "42,0 Mo",
"worldPayConf": {
"serviceKey": null,
"clientKey": null
},
"declination": true,
"goodies": {
"startDate": null,
"endDate": null,
"goodiesBalance": 693.55
},
"userConfiguration": {
"isSignatureMandatory": false,
"isDeliverDateMandatory": true,
"isDueDiligenceMandatory": false,
"isCheckinMandatory": true,
"checkinRadius": 20,
"customerProximityRadius": 100,
"canApplyDiscount": true,
"canApplyPartialPayment": true,
"notifyWithinNumber": 0,
"maxPartielDeliveryEchelon": null,
"maxDiscountRate": 50,
"notifyWithinType": "months",
"appointNotifyWithinNumber": 0,
"appointNotifyWithinType": "months",
"theme": "SELLER",
"askForReason": true,
"startTime": "8:00",
"endTime": "15:00",
"isGoodiesEnabled": true,
"canGoodiesAccumulate": true,
"canOrderIfCreditExceed": true,
"canDoPartialDelivery": false,
"canDuplicateItemInCart": false,
"canDoQuickOrder": true,
"generateOperationPdf": true
}
}
}
To get resized images, Replace
***
with
small
or
medium
in the link url before the image's name, for example:
<BASE_URL>/entity1-1450169988465/photoOrganization/small_1450349861417_valomnialogo.png
Remove
***_
to get the original image size.
Failure Output
The user will be redirected to https://BASE_URL/login/authfail?ajax=true on failure, and returns a JSON response.