Giter Site home page Giter Site logo

sdk-php's People

Contributors

abai-op avatar akent-op avatar jembar-op avatar jrebs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdk-php's Issues

Custom Object Tag By Name Not Working

There seems to be an issue with adding tag by name to a custom object.
The response says The tag is now being processed." but upon checking the custom object record, tags are not reflecting

$tagByNameParams = array(
            "objectID" => \OntraportAPI\ObjectType::CUSTOM_OBJECT,
            "ids"      => [10, 9],
            "add_names" => ['Test Tag']
);

$response = $this->client->custom(10003)->addTagByName($tagByNameParams);

Am I missing something here?

No way to pull product information

It seems that there is no way to interface with the products objects using the PHP SDK. If I had an objectID, I could use the objects() interface, but it seems like the Products are a little different than the other objects. This leads me to think we have to use the restful Products/Product controllers to interact with our products.

If my above summary is correct, I've created an initial commit adding a Ontraport->product() method and a related Products class which supports the basic Products rest actions. I haven't thoroughly tested it yet, and I didn't document possible keys because that can be taken from the published API docs by the developer, no need to duplicate, I think.

https://github.com/jrebs/SDK-PHP/commit/acc4324fe771df8e96a571df22c14874476eb0c6

I'd appreciate your comment on whether this is the right solution and, if not, what is, or suggest changes to the above to make it service-ready.

Thanks

Form API question

Hello! Quick question, is it possible to submit to an existing form created on Ontraport using the API?
I ask this since we already have a flow created on existing forms that categorizes leads, adds tags and subscribes to a certain newsletter.

Thank you!

ONTRAforms

How can I retrieve and interact with ONTRAforms?

How to construct externs query string - {object}//{field}

Hi, just want to ask regarding how to use the externs parameter, I've been checking the docs but it doesn't clearly says on how to construct the externs query string? If you could provide a sample it would be great as well, thanks.

update composer package?

Hello!

The composer package (and the 1.2.1 release in general) does not contain classes to control Tags.
Can you please update the version that you ship through composer?

saveOrUpdate not working with custom objects

I am not certain that this is a bug necessarily, but I've just spent a little while trying to get some updates to push to our custom objects and have now got it working by using another method.

Suppose a custom object with an objectID of 10001 and an object with ID of 1 that I wish to update. We have a custom field on this custom object that uses the field identifier "f1570" and contains a free formed string. f1570 currently has a value of 2.

$params = array('id' => 1, 'f1570' => 10);
$client->custom(10001)->saveOrUpdate($params);

This returns a code:0, no errors and returns the object's data in the response but the f1570 value does not update.

$params = array('objectID' ='10001', 'id' => 1, 'f1570' => 10);
$client->object()->saveOrUpdate($params);

The above should also work, to my knowledge, but it also returns a code:0 with the object data and does not update the custom field as requested.

$params = array('id' => 1, 'f1570' => 10);
$client->custom(10001)->update($params);

The update method DOES change the field as desired, returning a smaller set of data as usual when updates occur. Is there a problem with the saveOrUpdate implementation on custom objects or is this not supposed to work for some intended reason?

I think there is something wrong with the updates you have done

A PHP Error was encountered

Severity: Notice

Message: Only variables should be passed by reference

Filename: src/APIAutoloader.php

Line Number: 19

Backtrace:

File: /Applications/MAMPPRO/Sites/app.pum/SDK-PHP/src/APIAutoloader.php
Line: 19
Function: _error_handler

File: /Applications/MAMPPRO/Sites/app.pum/SDK-PHP/src/Ontraport.php
Line: 79
Function: spl_autoload_call

File: /Applications/MAMPPRO/Sites/app.pum/SDK-PHP/src/Ontraport.php
Line: 60
Function: setHttpClient

File: /Applications/MAMPPRO/Sites/app.pum/application/controllers/Update_views.php
Line: 13
Function: __construct

File: /Applications/MAMPPRO/Sites/app.pum/index.php
Line: 315
Function: require_once

Contacts saveOrUpdate

Hi, I'm having an issues with saveOrUpdate on the Contacts object.

Using this code here :
$payload = array (
'owner' => '',
'firstname' => 'Test',
'lastname' => 'Unique',
'email' => '[email protected]',
'address' => '',
'city' => '',
'f1666' => '133',
'zip' => '5051',
'f1665' => '',
'office_phone' => '040404040404',
'sms_number' => '040404040404',
'f1699' => '',
'f1700' => '',
'n_lead_source' => '',
'n_medium' => '',
'n_campaign' => '',
'n_term' => '',
'n_content' => ''
);
$response = $this->ontraport->contact()->saveOrUpdate( $payload );

If the Contact does not exist, the record is created OK and the created contact is returned.

However if I subsequently try this on a payload that looks like :

$payload = array (
'owner' => '',
'firstname' => 'Test',
'lastname' => 'Unique',
'email' => '[email protected]',
'address' => '',
'city' => '',
'f1666' => '133',
'zip' => '5051',
'f1665' => '',
'office_phone' => '0333333333',
'sms_number' => '0333333333',
'f1699' => '',
'f1700' => '',
'n_lead_source' => '',
'n_medium' => '',
'n_campaign' => '',
'n_term' => '',
'n_content' => ''
);

I get a response of :

'Save failed!'

What I'm expecting to happen is this contact record to be updated with the new office_phone and sms_number and have the new object returned.

Appreciate any insight.

Thanks

HTTP response codes are discarded

From the API documentation, it seems that if the response code is not a json success response with "code":"0", then the HTTP response code is meant to be used to diagnose the result (according to "Error and response codes" section of the API docs).

As an example, when I use the sdk to do a retrieveIdByEmail lookup on an email that doesn't exist in our account yet, I get back a simple string: "Object type with email '[email protected]' does not exist.".

It seems to me that the response code needs to be made available to the calling code. I can think of a few possible ways to go about it. Is this something that's already in the plans? I might have to come up with something on my end if it's not in the short term, in which case I'd be happy to hear your thoughts on the best implementation.

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.