Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ONTRAforms #17

Closed
tillkruss opened this issue May 29, 2019 · 16 comments
Closed

ONTRAforms #17

tillkruss opened this issue May 29, 2019 · 16 comments
Assignees

Comments

@tillkruss
Copy link

How can I retrieve and interact with ONTRAforms?

@akent-op
Copy link
Collaborator

Hi Till,

We do not have a great deal of functionality exposed for manipulating ONTRAforms (or really any of our forms) via our API. What we do have exposed is available in our Forms.php class. Primarily, you can retrieve them, and retrieve the object meta. We do have code samples for our forms class here: https://api.ontraport.com/doc/?php#forms. Let me know if there is anything else I can do to help.

Best,

Arielle

@tillkruss
Copy link
Author

tillkruss commented May 29, 2019

Thanks, Arielle!

I really only want to retrieve the JavaScript embed codes via the API. Right now we're copying the script tags around and it's impossible to know what's what.

Being able to fetch the script tags would be great, similar to what you offer with the SmartForm HTML.

I'm refering to these tags:

<script type='text/javascript' async='true' src='https://app.ontraport.com/js/ontraport/opt_assets/drivers/opf.js' data-opf-uid='p2c100000f100' data-opf-params='borderColor=#fff&borderSize=0px&embed=true&formHeight=1142&formWidth=589px&popPosition=mc&instance=n00000000'></script>

@akent-op
Copy link
Collaborator

Ah gotcha. OK. We don't have that specific endpoint enabled for ONTRAforms currently, but if you use the Forms::retrieveSingle method and grab the json_raw_object property from that response, you can json_decode that property and grab the mergedData from it. This should get you the script tags you want. I will note this as a feature request and look into wrapping this functionality better for ONTRAforms.

@akent-op akent-op self-assigned this May 29, 2019
@tillkruss
Copy link
Author

Amazing. I see that's giving me the actual HTML. Is there any way to get the <script> tags that I see under "Publish" on ontraport.com?

Screen Shot 2019-05-29 at 12 32 09 PM

@akent-op
Copy link
Collaborator

I see what you are saying. Sorry I misunderstood. We do not currently have an endpoint for this, but I can see its usefulness. I am going to look into this as a feature request.

@tillkruss
Copy link
Author

How soon will this be implemented and how do we know when it is?

@akent-op
Copy link
Collaborator

Hi Till,

I just got approval from our product team to implement this. I unfortunately do not have an exact ETA for you, as i the ticket needs to go through our regular process. However, I will keep you posted here as far as status so you will know when it is incoming. Hope this helps! Let me know if there is anything else I can do for you.

Best,

Arielle

@tillkruss
Copy link
Author

That's fantastic, thanks!

@akent-op
Copy link
Collaborator

akent-op commented Jun 5, 2019

Hi Till,

This functionality is implemented and moving into the testing phase. I will let you know when it is scheduled for release.

Best,

Arielle

@tillkruss
Copy link
Author

@arielle-ontraport: Any updates?

@akent-op
Copy link
Collaborator

Hey Till,

Sorry, not yet. Aiming to get this in the release sometime next week.

@akent-op
Copy link
Collaborator

Just an update: QA is almost done testing this, I will let you know when it gets merged in and has a firm release date.

@tillkruss
Copy link
Author

Amazing! Just in time!

@akent-op
Copy link
Collaborator

OK, the release is nigh. Code was just merged and will be released on Tuesday.

@akent-op
Copy link
Collaborator

akent-op commented Jun 25, 2019

Code was released this morning. For the SDK, we wrapped the original retrieveSmartFormHTML function into retrieveFormHtml which you can use on ONTRAforms as well. Let me know if I can be of further assistance!

@tillkruss
Copy link
Author

Thanks. Quick note: the method is called retrieveFormHTML().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants