In my laravel 5.7 app I make subscribe/unsubscribe to lists of mailchimp using https://github.com/spatie/laravel-newsletter
It works when ok and all users are suscribed to the current mailchimp list, which is described in .env file
MAILCHIMP_APIKEY = NNNNNNNNNN
MAILCHIMP_LIST_ID = NNNNNNNNNN # ID of 'subscribers' mailchimp list
But as my site has several group news I try subscribe to mailchimp list with code :
$retData= Newsletter::subscribe($userProfile->email, ['FNAME'=>$userProfile->first_name, 'LNAME'=>$userProfile->last_name], 'subscribers'); // 3rd parameter can be different
where 3rd parameter is mailchimp list name, as I see it on the server as : https://prnt.sc/mqbgnb
But I got error :
There is no list named `subscribers`.
Why error? Misconfiguring of of this mailchimp list ? It has some options, I am not sure if some of them is related to my issue ?
In doc I read as :
//Subscribe someone to a specific list by using the third argument:
Newsletter::subscribe('nanny.ogg#discworld.com', ['firstName'=>'Nanny', 'lastName'=>'Ogg'], 'Name of your list');
How to fix my error ?
Thanks!
Related
I'm sorry to ask this, but all docs are killed by Adobe. We need to implement our old magento with some orders from API. I can find docs to create quote and then confirm order, but I believe our checkout was modified and SOAP doesn't know about these methods.
So I have 2 problems:
address adding gives me getCheckoutType error. Don't know what's that and where to find this:
$res = $proxy->shoppingCartCustomerAddresses($sessionId, $cartId, $address, 1);
gives me error:
["faultstring"]=>string(51) "Call to a member function getCheckoutType() on null"
If only I could have method to get the already existing customer address to this call, maybe I could avoid the error in 1st point: shoppingCartCustomerAddresses
I'd appreaciate any help on any of problems.
I get all teams using the following API call:
GET https://graph.microsoft.com/beta/teams
How do I get the associated Group ID out of this call?
With the Teams Powershell module it is quite easy:
$GroupId = (Get-Team -DisplayName $NewTeamName).GroupId
Many thanks!
You cannot list teams using /teams, only get a specific team using /teams/{group-id}.
You can however list teams in an org. using this:
GET https://graph.microsoft.com/v1.0/groups?$filter=resourceProvisioningOptions/Any(x:x eq 'Team')
docs
this returns the id amoung others
Certain unused old teams will not have resourceProvisioningOptions set. For details, see known issues.
If you want to get ids from the users own joined teams, you can do this:
GET https://graph.microsoft.com/v1.0/me/joinedTeams
docs
How to get multiple orders filtered by Id from magento with help of rest api?
I tryed to use http://192.168.0.104:4422/magento/api/rest/orders?filter[1][attribute]=entity_id&filter[1][in]=1&filter[1][in]=3
but it returns me:
<magento_api>
<messages>
<error>
<data_item>
<code>401</code>
<message>oauth_problem=signature_invalid</message>
</data_item>
</error>
</messages>
</magento_api>
But if i use request with only one filter in parameter http://192.168.0.104:4422/magento/api/rest/orders?filter[1][attribute]=entity_id&filter[1][in]=1 - it works great.
For me the problem was in filters( I tried on 1.7.0.1). Looks like some magento versions have problems with filters. So you should use 1 filter, after that filter results in your code.
I found the answer in this blog post. In short, if you follow this structure (this was for my use case with a list of products):
http://magentohost.com/api/rest/products?filter[1][attribute]=entity_id&filter[1][in][1]=1&filter[1][in][2]=3
You'll be set! (this gets two products similar to above with ids 1 and 3). Notice the [1] and [2] after both of the [in]. I wish Magento had better documentation for this.
Try aggregating values.
complexFilter { key = "increment_id", value = new associativeEntity {key = "in", value = "1,2,3"} };
I need to report an event that comes under critical category.
Rest is working fine but i am having problems with using the ReportEvent for posting "critical" category event.
Code sample is something like:
const WORD LM_NT_LOG_CATEGORY_CRITICAL = 1;
WORD category;
category = LM_NT_LOG_CATEGORY_UNKNOWN;
ReportEvent(hEventSource,logLevel,category, event,NULL,2,0,
(const TCHAR**) &lpszStrings,
NULL);
In Windows Event Viewer for this particular event i see a "1" in Category column instead of "critical".
Can anyone please help me?
In order to get strings displayed in the Event Viewer you have to provide (and possibly localize) a mapping from your numeric categories. The rules are here.
Categories can be stored in a separate message file, or in a file that
contains messages of other types. If you create a single message file,
be sure that the categories are the first messages in the file.
I have added a custom order status option.
Does anyone know how I can set it to my custom value via the API?
Thanks to Diglin for pointing me in the right place. Just to present the answer properly:
You can do this by using the addComment method, which also lets you specify the new order status as one of it's parameters.
$sku='100000003';
$orderStatus = 'Downloaded';
$comment = 'The order was successfully downloaded';
$sendEmailToCustomer = false;
$proxy->call($sessionId, 'sales_order.addComment', array($sku, $orderStatus, $comment, $sendEmailToCustomer));
Hope this helps someone.
After to have seen the api doc and the source code, you can get only information about an order and add a comment to it. You cannot edit or delete an order. You have to create your own API if you need that.
See this link to see what is possible with the API: Magento Core API - Mage Sales