Retrieve data from calls to API Event Entry Source in custom activity - salesforce-marketing-cloud

I have a Journey with a API Event Entry source that points to a custom activity. I would like to retrieve data from the API call. I know I can do this by calling: {{Event.MY_EVENT_DEFINITION_KEY.data.myVariable}}, but my problem is that MY_EVENT_DEFINITION_KEY is not static since I would like to use this custom activity in different journeys with different event keys. I could retrieve the data with a request to the Data Extension but if there is a more straightfoward way to do it, that'd be cool. Thank you!

Related

Update shopify inventory automatically

I have a shopify website, but my fulfilment process is done outside of shopify, meaning that when the customer picks a product, it redirects to another service, were the fulfillment is done, and the the purchase is concluded. Because of that, shopify has no way to know if the purchase is concluded or not, so the store has to be updated manually. This is what I would like to avoid.Is is there an app, or a way I can update shopify by sending a json or a CSV with the updated products? And does uploading a CSV with the entirety of my data to repopulate my inventory a valid idea?
I expect there to be an outside service/App that might be able to help automate this, because I am able to receive a Json file (via an api) with all the info of the products that have been purchased, but I don't know how to use it to update shopify.
Even if you fulfill external to Shopify with a service, Shopify can be set to maintain your inventory by removing the sold inventory. Fulfillment does not really come into play.
Regardless though, Shopify does have an API, and there are handy calls that let you update 100 SKUs with a new quantity, in one API call, at one location. So if you have a CSV or JSON file, it is very easy to use that data to update Shopify. Make authenticated API calls. In the store itself, you can generate a token allowing API updates, and you can test with Postman, meaning your total investment in this is near zero.

Get drive files stats (views/openings) | Google Drive API

I've been searching the docs but I can't find anything.
The goal is to retrieve different stats from our files. Actually, we can retrieve almost everything we need, except for the document openings and document openings per user.
So here is the question: How can I retrieve document views of a drive document (a G Sheet to be more precise) ? Can I segment it by user ?
Thank you
I understand that your goals are the following one:
You want to retrieve document views
Of a particular document (and you know it's id)
Associated to a specific user
Please correct me if I get it wrong. If those are your goals, then you can use the Admin SDK as pointed out by Rubén in the comments. Now I am going to detail how you can make such a request easily.
You could use the method activities.list() to get a list with what you want. You only have to populate these four parameters:
Parameter
Value
Description
userKey
The user's email
Determine the user
applicationName
drive
Identifies the Google service
eventName
view
Designate the type of activity
filters
doc_id=={MY DOCUMENT ID HERE}
Filters by the document
That configuration will provide you with your desired data. Leave a comment below if you need help creating that request in your own environment.

Implementing IoT PowerBI table schema

I'm currently implementing an IoT solution that has a bunch of sensors sending information in JSON format through a gateway.
I was reading about doing this on azure but couldn't quite figure out how the JSON scheme and the Event Hubs work to display the info on PowerBI?
Can I create a schema and upload it to PowerBI then connect it to my device?
there's multiple sides to this. To start with, the IoT ingestion in Azure is done tru Event Hubs as you've mentioned. If your gateway is able to do a RESTful call to the Event Hubs entry point, Event Hubs will get this data and store it temporarily for the retention period specified. Then stream analytics, will consume the data from Event Hubs and will enable you to do further processing and divert the data to different outputs. In your case, you can set one of the outputs to be a PowerBI dashboard which you can authorize with an organizational account (more on that later) and the output will automatically tied to PowerBI. The data schema part is interesting, the JSON itself defines the data table schema to be used on PowerBI side and will propagate from EventHubs to Stream Analytics to PowerBI with the first JSON package sent. Once the schema is there it is fixed and the rest of the data being streamed in should be in the same format.
If you don't have an organizational account at hand to use with PowerBI, you can register your domain under Azure Active Directory and use that account since it is considered within your org.
There may be a way of altering the schema afterwards using PowerBI rest api. Kindly find the links below..Haven't tried it myself tho.
https://msdn.microsoft.com/en-us/library/mt203557.aspx
Stream analytics with powerbi
Hope this helps, let me know if you need further info.
One way to achieve this is to send your data to Azure Events Hub, read it and send it to PowerBI with Stream Analytics. Listing all the steps here would be too long. I suggest that you take a look at a series of blog posts I wrote describing how I built a demo similar to what you try to achieve. That should give you enough info to get you started.
http://guyb.ca/IoTAzureDemo

Can one track the usage of a shared resource from google drive

Does anyone here know if you on Google Drive somehow can track if a public shared link to a file have been used?
That is, the resource have been downloaded, viewed or otherwise "touched"?
Yes, and no
No: For consumer accounts.
Yes: For within a domain for Google Apps unlimited account, you can using the Admin API to receive view events.
Find the documentation here: enter link description here, relevant except follows.
Retrieve Google Drive events by event name
To retrieve a report of all instances of specific event type such as creating or editing a document, use the following GET HTTP request using the authorization token described in the authorization documentation. The userKey is the primary email address of the user in the report. The eventName can either be a access or acl_change event. For the eventName information, see the Drive event names reference information. For more information about the request's query strings and the response properties, see the API Reference. For readability, the following example is formatted with line returns:
GET https://www.googleapis.com/admin/reports/v1/activity/users/all
/applications/drive?endTime=a date&startTime=a date
&filters=event name parameter relational operator parameter value,...
&actorIpAddress=user's IP address
&maxResults=maximum number of events returned on a response page
&eventName=either a view or edit event

How do I insert/update data into offsite databases that don't have an API available?

I'm trying to figure out how to insert/update data into offsite databases that don't have an API available. Since they don't have an API, I thought of an approach I can take to insert/update data into their database.
They would first need to build a script and place it in an accessible location on their webserver that I can access via a URL. They would be required to supply the URL to me. I then can do a cURL POST request to that URL and pass a JSON array of the data that needs to be inserted. The script on their server would handle the parsing of the JSON array and the insert/update into the database.
I think this should work, but what security issues would I be opening them up to?
What you described is them creating an API. Just because the url invokes a script and isn't written in something like Java or PhP doesn't mean its not an api.
You need to make sure your url is secure so only authorized people can invoke it, and they would probably want to do data validation.
You should let them decide whether that is easier than standing up a more robust/non-script based solution