mailchimp api v.3 can't insert template_id on post campaigns - mailchimp

post campaigns
{
"type" :"regular",
"recipients": {
"list_id": "0270xxxcf7"
}
,
"settings": {
"subject_line": "Thank you for your reservation",
"from_name": "Customer Service",
"reply_to": "reception#xxxx.com",
"template_id": 37125
}
}
every time the response is with ["template_id"]=>int(0)
I tried with php script and directly from "Developer Playground"... I got the same response.
Seems it's not possible to set the template id when you create a new campaign.
If I setup template_id: '37125' I receive this error:
template_id must to be integer
I tried with intval(37125)....nothing, I got the same ["template_id"]=>int(0) response.
Can somebody help me with this issue?

You have to use the "Set campaign content" option
/campaigns/{campaign_id}/content

Related

How mention a group of teams in a flow of power automate?

I create a group for question in Microsoft teams, the name for this group is "Information Comunity". In this group, I put a Microsoft forms to capture the question.
Then, I create a Flow with Microsoft power Automate. This flow send send a message in "information Comunity" group, like this
I need to mention a other group in this message, the name of the other group is "Gerencia de information", this group will answer the question. But I donĀ“t know how to capture the name of thisgroup or how i get the id of the other group.
Can you help me please.
Thanks for your help.
1 The Flow will use a manual trigger.
2.After that the Flow initializes three variables as below:
3.First make sure that you invoke the HTTP request action connection using https://graph.microsoft.com as the Base Resource URL and Azure AD Resource URI values like in the screenshot below:
4.Then invoke the HTTP request
Body of the request:
{
"body": {
"content": "This is Flow mention channel test, <at id=\"0\">RA Experts</at>",
"contentType": "html"
},
"mentions": [
{
"id": 0,
"mentionText": "RA Experts",
"mentioned": {
"conversation": {
"id": "19:ac7b9c53a099498f9e08679e58f1f7fc#thread.tacv2",
"displayName": "RA Experts",
"conversationIdentityType": "channel"
}
}
}
]
}
Result:

" Mandatory fields missing" error while using ServiceNow API

I am using ServiceNow API to create a Catalog request.
URL:
https://<ServiceNow>/api/sn_sc/servicecatalog/items/6e2cc01d4f51ce08d4fb2b8ca310c7a6/order_now
BODY:
{
"sysparm_quantity":"1",
"variables": {
"requestor":"6e2cc01d4f51ce08d4fb2b8ca310c7a6",
"Requested For":"6e2cc01d4f51ce08d4fb2b8ca310c7a6",
"Group Name":"01304c6ddbef9f0827673672399619c4",
"Group Domain":"FG",
"Rationale for Approver Only (this will not be viewed by fulfillment team)":"testing"
}
}
I got this error :
{
"error": {
"detail": "",
"message": "Mandatory Variables are required"
},
"status": "failure"
}
How can I know what are the mandatory fields?
I figured out that this ID will be used to get the mandatory variables.
https://<ServiceNow>/api/sn_sc/servicecatalog/items/<Item_ID>/variables
However, I don't find it on the service now official documentation.
It should be a scripted API.
Check the elements tab in your browser (F12 for Chrome) while you have the form opened and search for "variable_tab" there you will see all expected variables. You can figure out how the mandatory ones are calle by looking at the form.

Slack API: Unable to get Chat:Write:Bot to send message as custom username

I'm trying to integrate Slack with our application using their web API. I need to use the chat.postMessage endpoint with a custom username and setting as_user = false. I'm able to post messages but when I set as_user=false it doesn't work.
Example:
{
"channel" : "1234689",
"text" : "Hello, It's me.",
"username": "DJDEPOLO",
"as_user" : false
}
Every time I make that call I'm getting back an error saying I'm missing chat:write:bot. But I can not figure out how to get that scope. I've tried everything I could think of and went over their documentation several times.
I tried requesting the scope using the OAuth route and when I add chat:write:bot to the scopes I get an error saying
Invalid permissions requested
Example:
https://slack.com/oauth/v2/authorize?scope=chat:write:bot&client_id=1234&redire....
It appears that I need to use the user token to perform this action but when I request my access token I'm getting back a bot token.
Has anyone ever had to work with chat:write:bot or any scope that ends with :bot? Or am I missing something here?
First, select your app at your apps for slack and navigate to 'OAuth & Permissions' page.
Then, click 'Update Scopes' in 'Scopes' section, scroll down, press 'Continue' and add chat:write to User Token Scopes. Then scroll down again and finish the process.
In order to get a user token, add user_scope param to your query instead of scope so that it looks like this https://slack.com/oauth/v2/authorize?user_scope=chat:write&redirect_uri=.... When you exchange the code for access token, you will receive something like this:
{
"ok": true,
"app_id": "A0KRD7HC3",
"team": {
"name": "Slack Softball Team",
"id": "T9TK3CUKW"
},
"authed_user": {
"id": "U1234",
"scope": "chat:write",
"access_token": "xoxp-1234",
"token_type": "user"
}
}
Pay attention to authed_user.access_token, as this is the token you need to send in your Authorization header.
Here is an example of POST body:
{
"channel": "Your channel id",
"as_user": true,
"text": "hi there",
"attachments": []
}
Hope it helps you.

Error while creating Sales Order with "API_SALES_ORDER_SRV"

we want to create a Sales Order with Cloud SDK (Version 1.9.2) using Virtual Data Model (A_SalesOrder) in our Java Application.
We are calling S4 OnPremise System (1709).
SalesOrder so = SalesOrder.builder()
.salesOrderType("ZKE")
.salesOrganization("DE01")
.distributionChannel("01")
.organizationDivision("00")
.build();
try {
SalesOrder salesOrder = new
SalesOrderCreateFluentHelper(so).execute(endpoint);
} ....
We are getting the following error (while executing via PostMan):
"errordetails": [
{
"code": "CX_SADL_ENTITY_SRVICE_NOT_SUPP",
"message": "The requested service is not supported by entity ~A_SALESORDER",
"propertyref": "",
"severity": "error",
"target": ""
},
{
"code": "/IWBEP/CX_MGW_MED_EXCEPTION",
"message": "An exception was raised",
"propertyref": "",
"severity": "error",
"target": ""
}
]
Can somebody give us a advise to create a Sales Order via the API?
How we can create Sales Order Items for this Sales Order in one Step?
Thanks!
Additional information OData Request Data
(Response Data not provided in ERROR_LOG):
Request-Header / Request-Body:
Apparently we received this error message because we did not include any items in the request. If you give it in your body it worked. Thank you
Can you pls share the OData request and response body and payload?
Open transaction /IWFND/ERROR_LOG, choose the error message and in the lower part of the screen, choose Request Data resp. Response Data and provide us both body and header. Make sure to omit any confidential data.

How to get the poster of a publication?

Actually, i'm getting the post_id of a facebook's post, and i'm searching to get the page who posts it. Does the functions "getParentId" return it?
According to the Facebook API documentation, the parent_id is "the ID of a parent post for this post, if it exists." As such, it's not what you're looking for.
You can get the id of the page to which a post belongs via facebook4j's getFrom method.
Graph explorer example:
postId=5281959998_10151166683754999
GET /v2.9/$postId?fields=from
{
"from": {
"name": "The New York Times",
"id": "5281959998"
},
"id": "5281959998_10151166683754999"
}

Resources