Outbound E-mail Profile API: Get list of e-mailaddresses - tridion

I'm working on a Java console application that needs to go through all the e-mailaddresses in the frontend database in Tridion Outbound E-mail 2011 and change a certain extended field of that contact.
I've gone through the Subscription API documentation for clues on how to get a listing of all the e-mailaddresses, but I'm getting stuck there. Is there any clean way to do this through the API, without resorting to database queries?

It is not possible to get a list of Contacts using the Subscription API. It is meant primarily for working with single Contacts, who update their profile on your website.
For bulk management of Contacts, you should use Tridion.AudienceManagement.API on your Content Management server instead. The changes will then be synchronized to all of your websites.
You should not change anything directly in the database, as you will get issues with synchronization.

Related

Any woocommerce REST API for guest account?

Woocommerce provides an API here which in order to use it, you have to provide a consumer key and consumer secret with a relevant authorization schema. What I fail to grasp is that, shouldn't be there an API for unauthorized / guest users ? I mean, I just want to create a display page (frontend) of available products, but without the need of generating CK/CS. Also looking in a similar question here
it seems that you cannot avoid using the keys. But a second question comes up. The frontend is not supposed to use the keys, because then the e-shop becomes exposed to the client. So, even by generating these keys in order to access woocommerce api, how am I supposed to correctly use them ? Please help me understand the flow.
TLDR;
Do NOT use CK/CS in front end. It's only for use in a secure backend. The keys can be used to read/write anything from products to, orders to all customer related information.
Based on you questions, I suspect APIs might not be the best way to do what you're intending to do. If you do need APIs, chances are, you have two backend servers communicating with each other. APIs are usually meant for use by other applications. For example, a lot of Point of Sale systems utilize this WooCommerce API. You might want to look into extending the WooCommerce plugin itself and creating end points to get the information or perform actions you need.
If you are not familiar with secure Authenticated APIs, I would highly suggest you familiarize yourself with them as failure to secure the website can result in huge financial losses to sensitive personal information leakage of the site users since WooCommerce APIs, at the time of this writing, only allows you to set read or write permissions with full access to everything.
With that in mind I will attempt to answer all of your questions one by one and give an idea of how you should use it.
To Answer your questions
What I fail to grasp is that, shouldn't be there an API for
unauthorized / guest users ? I mean, I just want to create a display
page (frontend) of available products, but without the need of
generating CK/CS
I'm guessing your misconception is that you need to use separate keys for each user. API keys are not meant to give access for front-end users. The API keys generated by the WooCommerece plugin gives full read/write access to any user to view/modify any information including that of other customers. Its meant for admins. If you check the official WooCommerce API reference for retrieving a customer you'll notice that you get to provide an id here. And if you check the response it shows everything from addresses to contact information.
The frontend is not supposed to use the keys, because then the e-shop
becomes exposed to the client. So, even by generating these keys in
order to access woocommerce api, how am I supposed to correctly use
them ?
Its quite simple actually. You just need to get between the communication between the front-end users and the WooCommerce API. If the users needs to be provided information from the WooCommerce end point, you need to get it for them using the CK/CS.
This way, you confirm what information is allowed to view/modify by whom, and the user does not need to be authenticated.
WooCommerce Endpoints <---> Your secure backend service/middleware/controller <---> front-end user
One thing to note though, is that you need to be careful about the parameters a front-end user is able to change in the request to your server end-point that is consuming the WooCommerce API key. A customer should not be able to change the id that is requesting their info for example. Id should be retrieved from the backend from the secure authentication information coming from the front-end.

How to update billing information for a Flex Token?

Currently, I'm working with 2 apps where user can generate a payment token associated with their account. 1 uses the Secure Acceptance Hosted Checkout and the other uses Flex Microform. 1 possible case involves the user's card being captured via the Microform and then later updated via the Hosted Checkout.
The docs mention being able to replace the billing info associated with the Flex token, but it's unclear the mechanism available. I'm aware that the Hosted Checkout supports updating this info, but it's preferred to make the update without prompting the user via the Hosted Checkout so the user never needs to see the default address or require putting in their address twice. Is there an endpoint that can be uses to achieve this?
I don't know if it's the intended way of doing things for cybersource, But there is a soap service named "paySubscriptionUpdateService" in the simple order (soap) api that allowed me update the name & address on a token generated via the flex api.
You can take a look at the simple order API documentation on cybersource website - chapter 7 "Updating a subscription"
https://developer.cybersource.com/library/documentation/dev_guides/Recurring_Billing/SO_API/Recurring_Billing_SO_API.pdf
I'm sure there is a way through rest API too, I'm not sure how to do it yet. I'll circle back if I see something

Accessing a WordPress Database from a mobile app

I have a WordPress website with custom tables that I store data into that was entered by customers. The site owner wants to develop a barcode app that can access this data. When I need the data from these fields to display within the site, I request it from a PHP script running on the server that make calls like get_post_meta().
The owner has hired a mobile app consultant who believes that, if he just has the password to the account where the site is hosted, he can access all of these database fields from the app.
I'm not seeing how this is possible. My understanding is that a mobile app can only access a site by making HTTP requests to it. It has no way of running on the server and executing things like get_post_meta().
Am I missing something?
Thanks
I think you are missing something. Wordpress now has a rest api https://developer.wordpress.org/rest-api/ that can allow a mobile application get at data in your database by making http requests.
The developer will need to be able to enable the Rest Api, but if you give her the password, she will probably be able to do so. Typically this is done using a plugin like: WP Rest API which enables a set of default endpoints which includes post meta data and allows you to add other endpoints
Depending on how the custom tables are set up, they might not be automatically available to the Rest API. However, if you are able to access them using get_post_meta() then I would expect that they would be accessible to the Rest API as well, most likely by adding endpoints.

Create opportunities in Marketo

I want to integrate Marketo api with my .net project.
My client has given a username & password to Marketo. I want to retrieve "opportunities" from Marketo. I have written code for that. Currently there are not any opportunities so I'm not able to test my code. Has anyone an idea how to create opportunities in Marketo so I can whetehr check my code is retrieving that records or not?
Opportunities are not visible as standalone entities in Marketo as they are in SFDC or other CRMs. Rather, as #joev said, you have to find a lead that has an opportunity and view the opportunity details within the context of that lead's detail view, on the Opportunity tab.
If you want to use the GUI to create an opportunity, the right place to do that would be in the CRM — not in Marketo.
You need to have create/update right via API, ask your client for create/update rights then you will be able to create some data through API itself.
Like other people have mentioned there isn't a direct GUI inside Marketo for creating opportunities. These are typically created via the CRM (aka Salesforce, NetSuite, Microsoft Dynamics, etc...) and then sync'd to Marketo.
If you want to test it and have no CRM available -- technically you can just use the REST API to sync your own opportunity to a lead. Once done you could login to Marketo to visually validate it. Then now that you have an opportunity created you could then use the API to GET the opportunities and further validate your integration.
Here is a link to Marketo's documentation on how to sync an opportunity to Marketo. Also on that page is the documentation on the other REST API options.

how to access user profile info on Login in Social Connect Module in Sitecore

I'm using Social Connect Module in Sitecore and using its Login functionality to get user info. The documentation states that the info is stored in the Core DB in aspnet_Profile table. "By default, the module saves the information from the social network in the fields with the corresponding prefixes. For example, fb is a prefix for Facebook fields." - this is the line in the doc.
However, i cant find such fields in the DB. Or should i be looking somewhere else?
I just want to see what info i'm receiving when the user logs in and would like to have access to it. Thanks in advance
When you say database, are you then checking the database using the Sitecore Shell and then switching to Core database or are you actually looking at the ASP.NET Membershipprovider tables in the database using SQL Management Studio?
You should be able to see the records in the table aspnet_Profile. The properties are stored kind of weird and is concatenated in the PropertyValuesStrings column.
You can also use the API to try and retrieve the values as described here: http://learnsitecore.cmsuniverse.net/Developers/Articles/2009/11/Custom%20user%20profile%20properties.aspx
More or less you have to call userProfile.GetCustomProperty(“fb[some property]”);
You could also take a look at the this blog: Social Connected with Sitecore (Facebook) 2: Access facebook information
This also gives you a sample of looping through all facebook properties from Core.

Resources