The following SOAP methods are provided specifically for interacting with coupon code lists.
copy
Creates a copy of the resource specified by resource_id
EvalancheResourceInformation copy (int resource_id, int category_id)Details: copy
create
creates an object
EvalancheResourceInformation create (string name, int category_id)Details: create
delete
Deletes the resource.
bool delete (int resource_id)Details: delete
generate
Find users by username
EvalancheUser generate(int coupon_list_id, int amount)
Parameter
- int coupon_list_id: ID of the voucher code list
- int amount: Number of voucher codes to be generated
Return value
- generateResult: Boolean: Result
Required rights
Manage voucher code list
Usage
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:coup="https://scnem.com/soap.php/soap/couponlist">
<soapenv:Header/>
<soapenv:Body>
<coup:generate>
<coupon_list_id>COUPON_LIST_ID</coupon_list_id>
<amount>AMOUNT</amount>
</coup:generate>
</soapenv:Body>
</soapenv:Envelope><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://scnem.com/soap.php/soap/couponlist">
<SOAP-ENV:Body>
<ns1:generateResponse>
<generateResult>true/false</generateResult>
</ns1:generateResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
getAll
Lists all resources within a client.
ArrayOfEvalancheResourceInformation getAll (int mandator_id)Details: getAll
getByCategory
Returns all objects of a folder.
ArrayOfEvalancheResourceInformation getByCategory (int category_id)Details: getByCategory
getByExternalId
Outputs all direct mailing templates with a given EXTERNAL_ID.
ArrayOfEvalancheResourceInformation[] getByExternalId ( string external_id )Details: getByExternalId
getById
Searches for a object using an ID.
EvalancheHashMap Profile::getById( int resource_id ) Details: getById
getByModificationDate
Requesting an object via modification date
EvalancheResourceInformation getByModificationDate (int start_date, int end_date, int mandator_id)Details: getByModificationDate
getByTypeId
Retrieve all resources within this namespace with the specified resource type ID (see the getTypeIds method).
ArrayOfEvalancheResourceInformation getByTypeId (int type_id, int mandator_id)Details: getByTypeId
getProfileCouponList
Read list of all voucher codes
EvalancheUser[] getProfileCouponList(int coupon_list_id)
Parameter
- int coupon_list_id: ID of the voucher code list
Return value
-
CouponList[]:
- int id: coupon ID
- string code: coupon code
- int profile_id: profile ID
- int creation_date: creation date
- int valid_to: code expiration date
Required rights
Manage voucher code list
Usage
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:coup="https://scnem.com/soap.php/soap/couponlist">
<soapenv:Header/>
<soapenv:Body>
<coup:getProfileCouponList>
<coupon_list_id>COUPON_LIST_ID</coupon_list_id>
</coup:getProfileCouponList>
</soapenv:Body>
</soapenv:Envelope><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://scnem.com/soap.php/soap/couponlist">
<SOAP-ENV:Body>
<ns1:getProfileCouponListResponse>
<getProfileCouponListResult>
<item>
<id>COUPON_ID</id>
<code>CODE</code>
<profile_id>PROFILE_ID</profile_id>
<creation_date>CREATION_DATE</creation_date>
<valid_to>VALID_TO</valid_to>
</item>
[...]
</getProfileCouponListResult>
</ns1:getProfileCouponListResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
getResourceDefaultCategory
Provides information about the default folder of objects
getResourceDefaultCategoryResponse getResourceDefaultCategory (int customer_id)Details: getResourceDefaultCategory
getTypeIds
Reading the type Ids belonging to an object class
ArrayOfEvalancheResourceInformation getTypeIds ()Details: getTypeIds
import
Imports existing voucher codes into an existing voucher code list
EvalancheUser import(EvalancheUser user)Parameter
-
CouponList:
- int id: voucher code list ID
- string code: voucher code
- int profile_id: optional profile ID
- int creation_date: voucher creation date
- int valid_to: expiry date of the voucher
Return value
- importResult: boolean
Required rights
Manage voucher code list
Usage
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:coup="https://scnem.com/soap.php/soap/couponlist">
<soapenv:Header/>
<soapenv:Body>
<coup:import>
<coupon_list_id>USER_ID</coupon_list_id>
<data>
<item>
<id>CODE_ID</id>
<code>COUPON_CODE</code>
<profile_id>PROFILE_ID</profile_id>
<creation_date>CREATION_DATE</creation_date>
<valid_to>VALID_TO</valid_to>
</item>
<!--Zero or more repetitions:-->
</data>
</coup:import>
</soapenv:Body>
</soapenv:Envelope><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://scnem.com/soap.php/soap/couponlist">
<SOAP-ENV:Body>
<ns1:importResponse>
<importResult>true/false</importResult>
</ns1:importResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
isAlive
Tests whether the API is available and the credentials used are valid. The `random_message` property of the result is completely irrelevant, since the values are randomly taken from http://whatthecommit.com.
isAliveResponse isAlive ()Details: isAlive
move
Moves the object to another folder
EvalancheResourceInformation move (int resource_id, int category_id)Details: move
removeAll
Removes all coupon codes of a coupon list
bool removeAll(int coupon_list_id)Parameter
- int
coupon_list_id: voucher code list ID
Return value
- removeAllResult: boolean
Required rights
Manage voucher code list
Use
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:coup="https://scnem.com/soap.php/soap/couponlist">
<soapenv:Header/>
<soapenv:Body>
<coup:removeAll>
<coupon_list_id>USER_ID</coupon_list_id>
</coup:removeAll>
</soapenv:Body>
</soapenv:Envelope><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://scnem.com/soap.php/soap/couponlist">
<SOAP-ENV:Body>
<ns1:removeAllResponse>
<removeAllResult>true/false</removeAllResult>
</ns1:removeAllResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
removeById
Removes a single coupon code from a coupon list
bool removeById(int coupon_list_id, int profile_coupon_id)Parameter
-
int coupon_list_id: voucher code list ID
int profile_coupon_id: voucher code ID
Return value
- removeByIdResult: boolean
Required rights
Manage voucher code list
Use
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:coup="https://scnem.com/soap.php/soap/couponlist">
<soapenv:Header/>
<soapenv:Body>
<coup:removeById>
<coupon_list_id>COUPON_LIST_ID</coupon_list_id>
<profile_coupon_id>COUPON_ID</profile_coupon_id>
</coup:removeById>
</soapenv:Body>
</soapenv:Envelope><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://scnem.com/soap.php/soap/couponlist">
<SOAP-ENV:Body>
<ns1:removeByIdResponse>
<removeByIdResult>true/false</removeByIdResult>
</ns1:removeByIdResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
rename
Gives the object a different name
EvalancheResourceInformation rename (int resource_id, string name)Details: rename