Coder Social home page Coder Social logo

maxcontact's Introduction

MaxContact PHP API

... well csv file upload!

Requirements

PHP 5.4+

Installation using Composer

Add ianchadwick/maxcontact to the require part of your composer.json file

"require": {
  "ianchadwick/maxcontact": "dev-master"
}

Then update your project with composer

composer update

CSV file upload to mapping

use MaxContact\Client;
use MaxContact\Commands\ImportCsvFiles;

# Create a new client, the url is unique to each account so you'll want to speak to MaxContact support to get yours.
# They will also be able to provide you with the username and password for use with the API.
$client = new Client('username', 'password', 'https://myusernameapi.maxcontact.com/myusernameapi');

# Create some kind of file upload
# List ID and mapping name will be provided by support again.
# The mapping that is requested will determine the key names below.
$command = new ImportJsonFiles(1, 'LiveFeedMap', [
    [
        'firstName' => 'Ian',
        'phone' => '012345678765',
        # ... any additional feeds that are mapped
    ]
]);

# upload the file and return a true on success
$client->execute($command);

# To get the response from the last request
var_dump($client->getLastResponse()->getBody()->getContents());

# Or get the XML
var_dump($client->getLastResponse()->xml());

maxcontact's People

Contributors

ianchadwick avatar

Watchers

 avatar  avatar

maxcontact's Issues

guzzlehttp/guzzle version dependency

I am trying to use this with the latest Drupal version and composer update is giving me these errors.

Problem 1
- Can only install one of: guzzlehttp/guzzle[6.2.1, 5.3.x-dev].
- Can only install one of: guzzlehttp/guzzle[6.2.2, 5.3.x-dev].
- Can only install one of: guzzlehttp/guzzle[6.2.3, 5.3.x-dev].
- Can only install one of: guzzlehttp/guzzle[6.3.0, 5.3.x-dev].
- Can only install one of: guzzlehttp/guzzle[6.3.1, 5.3.x-dev].
- Can only install one of: guzzlehttp/guzzle[6.3.2, 5.3.x-dev].
- Can only install one of: guzzlehttp/guzzle[6.3.3, 5.3.x-dev].
- Can only install one of: guzzlehttp/guzzle[6.3.x-dev, 5.3.x-dev].
- Can only install one of: guzzlehttp/guzzle[5.3.x-dev, 6.3.3].
- ianchadwick/maxcontact dev-master requires guzzlehttp/guzzle ~5.0 -> satisfiable by guzzlehttp/guzzle[5.3.x-dev].
- Installation request for ianchadwick/maxcontact dev-master -> satisfiable by ianchadwick/maxcontact[dev-master].
- Installation request for guzzlehttp/guzzle ^6.2.1 -> satisfiable by guzzlehttp/guzzle[6.2.1, 6.2.2, 6.2.3, 6.3.0, 6.3.1, 6.3.2, 6.3.3, 6.3.x-dev].

I would request to update the guzzle package version to the latest i.e.

"guzzlehttp/guzzle": "~6.0"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.