Coder Social home page Coder Social logo

Comments (7)

nathanwaters avatar nathanwaters commented on June 9, 2024 4

Getting the same issue with custom fields using personalization tags, eg field[%CITY%,0]. What's the fix?

Edit: Fixed. I'm guessing the wrapper doesn't process multiple tags. Had to split the field parameter into a separate array like so:

  $contact = array(
    'p[1]'                   => 1,
    'status[1]'              => 1,
    'email'                    => 'john@doe',
      'first_name'               => 'John',
      'last_name'                => 'Doe'
    );
  $contact['field'] = array(
    '%CITY%,0'      => 'city',
    '%STATE%,0'      => 'state',
    '%POSTCODE%,0'      => 'postcode'
  );

from activecampaign-api-php.

pevans avatar pevans commented on June 9, 2024 2

Hmm... the form is correct, supposing that you have a custom field with the id that you are passing in. Could you submit a ticket through the help section in your account with some form of the code you're using to make the API call?

Thanks!

from activecampaign-api-php.

elieandraos avatar elieandraos commented on June 9, 2024

Sure. Will do.

from activecampaign-api-php.

nickrouty avatar nickrouty commented on June 9, 2024

@nathanwaters I know this was awhile ago... but you da' man. Thanks for adding that solution in there. The docs/examples aren't clear on it at all.

from activecampaign-api-php.

msavvy avatar msavvy commented on June 9, 2024

It seems that i'm having some issues with the api. I have the following:

`$url = $credentials['api_url'];

    $params = array(
      'api_key' => $credentials['api_key'],
      'api_action' => $api_action,
      'api_output' => 'serialize',
    );

    $list = 'p[' . $credentials['list_id'] . ']';
    $status = 'status[' . $credentials['list_id'] . ']';

    $token = filter_xss($token);

    if($api_action == 'contact_add') {
      $post = array(
        'email' => $email,
        'first_name' => $firstname,
        'last_name' => $lastname,
        'tags' => $tags,
        $list => $credentials['list_id'],
        $status => 1,
      );

      $post['field'] = array(
        '%TOKEN%,0' => $token,
        '%SAVVYREDIRECTURL%,0' => $redirect_url,
        '%PHONE%,0' => '131234',
      );
    }
    elseif($api_action == 'contact_edit') {

      $post = array(
        'id' => $contact_id,
        'first_name' => $firstname,
        'last_name' => $lastname,
        $list => $credentials['list_id'],
      );

      $post['field'] = array(
        '%TOKEN%,0' => $token,
        '%SAVVYREDIRECTURL%,0' => $redirect_url,
        '%PHONE%,0' => '131234',
      );
    }`

what it did is it just saves the token, but not the customurl and the phone fields.

may i please ask what's wrong or what's missing? thanks.

from activecampaign-api-php.

bartboy011 avatar bartboy011 commented on June 9, 2024

@msavvy On which of those is that happening? Or is it both?

Also, are you using this wrapper? I ask because if so, you wouldn't need api_key nor api_action params since the wrapper handles those for you. If you aren't using the wrapper, then that's your issue, you'd need to look at the documentation on making an API call without the wrapper which can be found here - https://www.activecampaign.com/api/example.php?call=contact_add

from activecampaign-api-php.

Nikitapcrafter avatar Nikitapcrafter commented on June 9, 2024

I am trying to fetch custom field data from deals. so please suggest any API fo this.

from activecampaign-api-php.

Related Issues (20)

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.