How to create a store and get store id in mail chimp for drupal commerce? - mailchimp

I need store id(store_id) to pass the value in this API.
/ecommerce/stores/{store_id}/carts

You need to first add a store to MailChimp using below API. Whatever id you pass in this request will be your store id for the subsequent requests.
https://usX.api.mailchimp.com/3.0/ecommerce/stores:
{
"id" : "store_001",
"list_id" : "205d96e6b4",
"name" : "Freddie's Jokes",
"domain" : "www.freddiesjokes.com",
"email_address" : "merchandise#freddiesjokes.com",
"currency_code" : "USD"
}
You can further check the Api at:
https://developer.mailchimp.com/documentation/mailchimp/reference/ecommerce/stores/

Related

YouTube V3 LiveBroadcasts: list issue with service account credentials

I was trying to make list api call to get the list of upcoming live streams. But when I was using service account credentials the API is always responding with below status.
{
"code" : 403,
"errors" : [ {
"domain" : "youtube.liveBroadcast",
"message" : "The user is not enabled for live streaming.",
"reason" : "liveStreamingNotEnabled",
"extendedHelp" : "https://www.youtube.com/features"
} ],
"message" : "The user is not enabled for live streaming."
}
Please let me know if I have to assign any specific role in IAM for this particular service account to allow this API to work.

Where to find RingCentral business-address email address?

The following business-address endpoint
URL: /restapi/v1.0/account/{accountId}/business-address
Ref: https://developer.ringcentral.com/api-docs/latest/index.html#!#RefGetAccountBusinessAddress
returns an email address property but it's coming back empty for me. There's no email address field on the Company Info page in the Online Account Portal UI at https://service.ringcentral.com:
Admin Portal > Phone System > Company Info > Company Address
The API Reference shows the following example response:
{
"uri" : "https.../restapi/v1.0/account/1215058004/business-address",
"businessAddress" : {
"street" : "13 Elm Street",
"city" : "Foster City",
"state" : "CA",
"zip" : "94404",
"country" : "United States"
},
"company" : "MyCompany Inc.",
"email" : "firstname.lastname#mycompany.com"
}
Can you tell me what config/UI element maps to the email address returned by the business-address endpoint?
The account/business-address API endpoint email property corresponds to the following UI field in the Online Account Portal - https://service.ringcentral.com :
Admin Portal > Phone System > Company Info > Directory Assistance > Email
The fields on that page will change the businessAddress, company, and email fields in the account/business-address API endpoint.
Note: Directory Assistance is not available in the Sandbox Account and can only be viewed/updated in Production.
Here is a screenshot from this knowledge base article:
https://success.ringcentral.com/knowledge/TOCArticleRendererPkb.apexp?id=kA280000000GscW

MailChimp send the same email multiple times

Is it possible to send the same email multiple times?
I tried via API to add email to queue, but I cannot remove it anyway. And if I don't, I get message "You've already sent this email to the subscriber." There was answer in another question. However, I need to be able to send email many (not constant) times, thus creating N amount of campaigns does not work for me. Therefore, the only option was to remove subscriber from list and add it back again, however, also doing this did not trigger the email to be sent.
Am I out of luck with MailChimp, is there a way or am I doing something wrong?
You are doing rigth, it is one of mailchimp 'smart' restrictions, like 'no more than 255 symbols in merge field'. You can workaround it, just create new campaign with one email.
I post example below, replace placeholders with rigth values. You can find TEMPLATE_ID in browser address bar when you edit template. (templates/design?tid=TEMPLATE_ID)
POST https://usX.api.mailchimp.com/3.0/campaigns
{
"type" : "regular",
"recipients" : {
"list_id" : "${LIST_ID}",
"segment_text" : "${SUBJECT}",
"segment_opts" : {
"match" : "all",
"conditions" : [ {
"condition_type" : "TextMerge",
"op" : "is",
"field" : "EMAIL",
"value" : "${USER_EMAIL}"
} ]
}
},
"settings" : {
"subject_line" : "${SUBJECT}",
"title" : "${SUBJECT}",
"from_name" : "${YOUR_COMPANY}",
"reply_to" : "${YOUR_COMPANY_EMAIL}",
"to_name" : "*|FNAME|* *|LNAME|*",
"template_id" : ${TEMPLATE_ID}
}
}
after creating, check subscriber count ( should be "recipient_count":1), save campaign id and start campaign.
POST https://usX.api.mailchimp.com/3.0/campaigns/${CAMPAIGN_ID}/actions/send
after that, wait some time, no less than 1 min, and delete campaign with
DELETE https://usX.api.mailchimp.com/3.0/campaigns/${CAMPAIGN_ID}

how to use Postman to Insert Document in Elastic Search

What i need
i need to Insert Test document.
i have followed link https://www.elastic.co/guide/en/elasticsearch/reference/current/_index_and_query_a_document.html
Here im trying
PUT /customer/_doc/1?pretty
{
"name": "John Doe"
}
Error request body is required
snapshot when i try to run url
1.http://localhost:9200/customer?pretty
2.http://localhost:9200/customer/_doc/1?pretty&pretty
3.http://localhost:9200/customer/_doc/1?pretty&pretty&name=test
can anyone suggest how to Insert document in Elastic search.
any suggestion is most welcome.
Pass the Json in body and change the URL as shown below:
Use the PUT method for the same.
The url would be "http://localhost:9200/movies/"
movies is the name of the index.
The json to post is :
{
"id" : 1,
"title" : "Toy Story 1",
"year" : 1995,
"category" : "Adventure"
}
Here is the screenshot of the postman pushing the data to elasticseach :
You can verify the data as below :
Use the GET method and the url as http://localhost:9200/movies/_search?

Spring reactive mongodb get subdocument

My application has users and servers, every user can have multiple servers. I would like to get a server by giving the user Id and the server name.
Example database:
{
"_id" : ObjectId("5a168093abfc7d0da1eaf039"),
"email" : "test#test.com",
"name" : "asdf",
"password" : "$2a$10$sC2WjxBdmsmN/x4GI7rgS.HBr4C.W8oxFJ7p/WMC24YcoARX8pNba",
"is_admin" : false,
"servers" : [
{
"_id" : BinData(3,"5xEk0HAIc7P+JevFrKP5lQ=="),
"name" : "asdf",
"host" : "asdf",
"ssl" : true
}
],
"_class" : "com.stack.database.main.model.User"
}
The user id is unique and the server name is unique per user. I would like to get the Server model(The servers list, not an actual #Document but a sub document) by giving the user id(5a168093abfc7d0da1eaf039) and the server name(asdf). I would like to use the repositories for this, the ReactiveCrudRepository repository.
I know I can get a user with a certain certain server name by using this in the UserRepository:
Mono<User> findByServers_Name(String name);
But I want to get the server model based on the user id and server name. I was thinking about something like this:
Mono<Server> findByIdAndServers_Name(ObjectId id, String name);
Note that this also has to be in the user model because the Server has no repository because it is a sub document.
How can I can a server model based on user id and server name with reactive crud repositories?

Resources