dandemeyere / responsys-api

MIT License
19 stars 19 forks source link

Implementation of table and profile extension #3

Closed florrain closed 10 years ago

florrain commented 10 years ago

Dear team,

Here are a few changes made to the repo to welcome tables and profile extension tables. Because I needed new features, I changed some little things. Below you'll find a summary of my work.

API

Client

Examples of the hash returned :

# Failure
{ status: "failure", error: { http_status_code: 500, code: "RECORD_NOT_FOUND", message: "No records found in the list for given ids" } }

# Ok
{ status: "ok", data: [{ "EMAIL_ADDRESS_": "user1@email.com", MOBILE_NUMBER_: "0000000001" }, { EMAIL_ADDRESS_: "user2@email.com", MOBILE_NUMBER_: nil }, { EMAIL_ADDRESS_: "user3@email.com", MOBILE_NUMBER_: "0000000000" }] }
Responsys.configure do |config|
  config.settings = {
    username: "your_responsys_username",
    password: "your_responsys_password",
    wsdl: "https://wsxxxx.responsys.net/webservices/wsdl/ResponsysWS_Level1.wsdl",
    debug: true
  }
end

Tests

Other

Notes

Thanks for your comments !

florrain commented 10 years ago

Would you check the types of object passed to each function ?

For instance take retrieve_profile_extension_records(interact_object, query_column, field_list, ids_to_retrieve). At the beginning of the function there would a check of all params : interact_object.is_a? InteractObject and query_column.is_a? .....

I know it's generating a large amount of code if we do it so for all functions. Also Ruby has not been thought for type checking. My question is : should we check params of all functions and handle/raise exceptions if so. Related to this I coded a raised exception in FieldType and QueryColumn API objects if the constructor param is not an accepted type/column.

florrain commented 10 years ago

Now closing, everything's been pushed to master.