Facebook Ads /insights endpoint action_target_id breakdown - facebook-ads-api

With the old /reportstats endpoint you could fetch actions grouped per target name by adding action_target_name to the group options. This would give you a list of targets and their actions. In the new API endpoint /insights, only action_target_id is available as group option. The target can be anything, e.g. a post, a pixel, etc. but there is no type indication returned, so all you have is an ID and some actions...
So, when grouping actions by action_target_id, is there any way to get the target's name that belongs to the ID?

Related

Dialogflow CX: capture a parameter from an annoted training phrase

I'm building a chatbot with the Dialogflow-CX V3 console. The bot allows users, among other things, to place an order for a new project. Each project must have a name, so I define a parameter called projectName that the user must provide. I have defined a custom entity type called projectNameText, a regex. I can capture projectName in a form using a typical Q-and-A format:
bot: What is the project name?
user: SalesPitch
But that is rather tedious. I want to allow more freeform user input and capture the projectName using an annotation on an intent training phrase.
bot: What would you like to do?
user: I'd like to make a new project called SalesPitch
When I define a training phrase for an intent like
I'd like to make a new project called Annabel
I can highlight Annabel in the console's intent editor and annotate that as an entity of type #projectNameText as described here. But that instantly creates a parameter with Parameter id projectNameText. And I cannot edit that Parameter id. I can't require that when Dialogflow matches that training phrase and extracts an entity of type projectNameText, it puts it into the parameter projectName. Dialogflow demands that it goes into a parameter called projectNameText. When I run the simulator and type input that matches that training phrase, Dialogflow does indeed correctly extract the entity, but will only create a parameter named projectNameText - I can see the name and value in the simulator.
This answer implies that I can send the matched entity into any parameter I want. That would be sensible. But how do I do it? I can't find any way to edit the parameter name in the Intent editor. All it gives me is this:
and I cannot change the Parameter Id.
I must be missing something really basic. Hints, please?
It is indeed not possible to edit the Parameter Id in the Intent Editor directly.
Instead, in the Intent Editor from the Build tab, accept the default Parameter Id, and Save the modified intent.
Then go to the tabs on the left of the Dialogflow CX console and choose the Manage tab. Choose Intents from the menu and find the intent you have just edited from the menu. Click the intent name to be given a different version of the Intent Editor. Same fields, same data, different functionality. In this different Intent Editor, click the Parameter Id you want to edit. It is now editable. Do not forget to hit Save after editing it.
From start to end, that took thirteen days to find. I posted here and received no answer. I finally subscribed to Google Cloud paid support and raised a support case and was given the answer in a video call with Google India. Perhaps it should be in the Google Documentation.

Dialogflow CX: $session.params.list as a separate entity type

Let's say I have a dynamic list of items which I upload from a webhook at a certain step of a scenario. This list is not a list of some type of pre-defined entities, this is just a list of something.
So,
$session.params.items = ["item_1", "item_2"]
Now, at the next step user can either choose one of the options provided in this list or make something else. It seems that the best way to check whether the next user query has something to do with our list of items, I need to declare a non-required parameter. But if I do this way, they necessarily require an entity type.
So, the question is:
Is is possible to use any list or dict from session parameters as an entity type?
What is the best way to implement checking whether user query falls into one of the session variables like list taking into account that user query may as well go to other intent and so on. I supposed the best way is to have routes for filling in unnecessary parameters and for intents, but still I can't do the first part.

Slack does not render properly a suer by userID through workflow

Save a userID in a google sheet doc.
Try to push a message in a chat with the userID (read from the doc) but instead of normal #AdamLol I see <#USERID123>.
Can I somehow see the real name?
Since at-handles can change, it's not recommended to rely on them. As such, you have three options in terms of output.
Name
Mention (user ID)
Email
You can pick between these options by choosing from the dropdown beside the variable

Can SCIM update non SCIM-created resources?

Specifically, can SCIM be used to add Users to pre-existing (non SCIM-created) groups? We need to provision users via SCIM, but then add them to Groups created manually in the site (a .Net application).
As I understand it, it can't be done like this. Group Update requests (i.e. PATCH requests) seem to require the "id" attribute as the unique identifier for the group, and this "id" seems to be only generated in SCIM Create Requests. So if a Resource (Group / User) wasn't originally created via SCIM, SCIM can't update/replace/delete it. Is that correct?
e.g. PATCH /Groups/acbf3ae7-8463-4692-b4fd-9b4da3f908ce
I thought about a workaround convention, such as using "user:1234" and "group:1234" as the "id" attribute format (i.e. [resource type]:[internal type-specific ID]), and then any User or Group can be specified by "id", even if it wasn't created via SCIM. But that seems pretty hacky.
Is there a better way of doing this? Many thanks for any help, very new to SCIM!
Yes, SCIM can be used to manage "brownfield" scenarios where existing non-SCIM created objects exist.
Typically the logic flow that happens for a user object is:
GET on /users with a filter (as defined in RFC7644 3.4.2.2) using an attribute that is uniqueness constrained (such as userName, email).
If no user found matching that criteria, create a new user with POST to /users
If a user was found, it should bereturned with an id value even if it was not created via SCIM
The general logic of "Search using a friendly identifier -> create if not found/cache the id value and associated it with existing user in the other directory" is pretty simple and can be successfully used with other object types (ie: groups) as well.

note passed in as part of CreateCheckoutRequest, but where to on the payment page or the dashboard to view them?

I am using nodeJs, and I have passed in note inside CreateCheckoutRequest, however, i am not seeing the note showing on the payment page url generated by createCheckout or the dashboard page.
My ultimate goal is our frontend can pass in the phone number as note to sqaure-connect, so that we can view the phonenumber from our dashboard once the customer completes an order
Tried to look at old transactions, since we didnt use note, didnt see any note.
const checkout = SquareConnect.CreateCheckoutRequest.constructFromObject({
idempotency_key: 'sample_key,
order: orderRequest,
redirect_url: redirect_url,
ask_for_shipping_address: true
note, // need to see it from dashboard once the user completes an order
});
When adding a note to a CreateCheckout request, it will end up on the tenders->note field of the associated transaction. To clarify, once the customer has paid on the checkout page, it should redirect to your web page (based on your redirect_url field that you passed to CreateCheckout originally). From there, the url will contain a parameter called transaction_id. You can then use this id to retrieve the transaction and digging into it to find the note (transaction->tenders[0]->note). In this particular use case, there will always only be one tender since Checkout doesn't allow multiple tenders.
Now, to actually answer your question: the tender note will be displayed as the main text you see when you view your transactions. So when you login to your Square Dashboard and click Transactions, in the main list, the "header" will be whatever the tender note was.

Resources