Sha256: 9c58b642e8243ef8ae4f35193cb36b81b64a4c32f0be5e5d21db7f9913998a14
Contents?: true
Size: 1017 Bytes
Versions: 2
Compression:
Stored size: 1017 Bytes
Contents
module Emarsys module Api class Services < Base def launchlist_get(customer_id, campaign_id, limit = 10_000, offset = 0) # rubocop:disable Metrics/ParameterLists params = { limit: limit, offset: offset } response = client.get "customers/#{customer_id}/campaigns/#{campaign_id}/launch_list/contact_ids/", params validate_response! response response.body['contact_ids'] end def email_queue(customer_id, params) response = client.post "customers/#{customer_id}/email_queue/", JSON.generate(params) validate_response! response response.body end private def module_path '/api/services' end def parse_for_error(response) errors = response.body['errors'] if response.body.is_a?(Hash) && errors.is_a?(Array) && errors.first.is_a?(Hash) [errors.first['message'], response.status, errors.first['code']] else super end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
emarsys-api-0.3.0 | lib/emarsys/api/services.rb |
emarsys-api-0.2.0 | lib/emarsys/api/services.rb |