MWS API feeds - delete all images on a product - amazon-mws

I'm wanting to delete multiple images on a product in Amazon, using the MWS XML API.
I can delete 1 image at time with:
<MessageType>ProductImage</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Delete</OperationType>
<ProductImage>
<SKU>xxxxx</SKU>
<ImageType>PT1</ImageType>
</ProductImage>
</Message>
can I specify more than one ImageType in that block (comma separated, semi-colon, ...)? I'm not good at reading XSD files...
https://sellercentral.amazon.com/gp/help/200386840
Should I just have multiple messages in the one XML feed?

Should I just have multiple messages in the one XML feed?
Yes. You should have one AmazonEnvelope, containing one Header, one MessageType and multiple Message structs. Messages can create or delete one image each.

Related

The createdFrom field on NetSuite Invoice is not populating when using SOAP Web Services via Workato

I am using Workato for my Salesforce to NetSuite integration and everything works perfectly with the exception of populating the createdFrom field on the Invoice record. Has anyone been successful in linking the NetSuite Invoice to its associated Sales Order using Web Services? This is critical as the linkage ensures that Revenue Arrangements are not duplicated in NetSuite.
I do not have first hand experience with SOAP Web Services but have seen via SuiteScript 2.x that one cannot simply create the record and try to fill in the createdFrom field. You must rather "transform" a Sales Order into an Invoice for example. The "transformation" is what links the two. Looks like for SOAP the operation is named "initialize / initializeList". The SOAP web services initialize operation emulates the UI workflow by prepopulating fields on transaction line items with values from a related record. Reference Suite Answer 10771 for more information. Suite Answer 91358 also has some sample code.
yes I have created invoices from Sales Order using SOAP Webservices. I am using minimum number of required fields to create the invoice.
Here is the endpoint URL that I used : https://(insert your account Id here).suitetalk.api.netsuite.com/services/NetSuitePort_2020_1
Note 1: You need to make sure that the version is consistent through out your SOAP request (in my case it's 2020_1)
Note 2: You can see that I am passing createdFrom tag as second last tag and I am passing Sales order's internal ID there. That means that invoice is being generated from that particular sales order and it carries over rest of the fields from sales order
Note 3: I am passing externalid of the invoice at the end which will the unique id of this newly created invoice across different systems
Please let me know how this goes!
<soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:messages="urn:messages_2020_1.platform.webservices.netsuite.com" xmlns:accountingLists="urn:accounting_2020_1.lists.webservices.netsuite.com" xmlns:employeesLists="urn:employees_2020_1.lists.webservices.netsuite.com" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:employeesTransactionsTypes="urn:types.employees_2020_1.transactions.webservices.netsuite.com" xmlns:demandplanningTransactions="urn:demandplanning_2020_1.transactions.webservices.netsuite.com" xmlns:common="urn:common_2020_1.platform.webservices.netsuite.com" xmlns:commonTypes="urn:types.common_2020_1.platform.webservices.netsuite.com" xmlns:accountingListsTypes="urn:types.accounting_2020_1.lists.webservices.netsuite.com" xmlns:customizationSetup="urn:customization_2020_1.setup.webservices.netsuite.com" xmlns:inventoryTransactionsTypes="urn:types.inventory_2020_1.transactions.webservices.netsuite.com" xmlns:supportLists="urn:support_2020_1.lists.webservices.netsuite.com" xmlns:filecabinetDocuments="urn:filecabinet_2020_1.documents.webservices.netsuite.com" xmlns:bankTransactionsTypes="urn:types.bank_2020_1.transactions.webservices.netsuite.com" xmlns:communicationGeneralTypes="urn:types.communication_2020_1.general.webservices.netsuite.com" xmlns:customizationSetupTypes="urn:types.customization_2020_1.setup.webservices.netsuite.com" xmlns:supplychainListsTypes="urn:types.supplychain_2020_1.lists.webservices.netsuite.com" xmlns:core="urn:core_2020_1.platform.webservices.netsuite.com" xmlns:coreTypes="urn:types.core_2020_1.platform.webservices.netsuite.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:supplychainLists="urn:supplychain_2020_1.lists.webservices.netsuite.com" xmlns:demandplanningTransactionsTypes="urn:types.demandplanning_2020_1.transactions.webservices.netsuite.com" xmlns:websiteLists="urn:website_2020_1.lists.webservices.netsuite.com" xmlns:salesTransactions="urn:sales_2020_1.transactions.webservices.netsuite.com" xmlns:salesTransactionsTypes="urn:types.sales_2020_1.transactions.webservices.netsuite.com" xmlns:relationshipsLists="urn:relationships_2020_1.lists.webservices.netsuite.com" xmlns:inventoryTransactions="urn:inventory_2020_1.transactions.webservices.netsuite.com" xmlns:employeesListsTypes="urn:types.employees_2020_1.lists.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:customersTransactions="urn:customers_2020_1.transactions.webservices.netsuite.com" xmlns:schedulingActivitiesTypes="urn:types.scheduling_2020_1.activities.webservices.netsuite.com" xmlns:financialTransactions="urn:financial_2020_1.transactions.webservices.netsuite.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:relationshipsListsTypes="urn:types.relationships_2020_1.lists.webservices.netsuite.com" xmlns:employeesTransactions="urn:employees_2020_1.transactions.webservices.netsuite.com" xmlns:faults="urn:faults_2020_1.platform.webservices.netsuite.com" xmlns:marketingListsTypes="urn:types.marketing_2020_1.lists.webservices.netsuite.com" xmlns:communicationGeneral="urn:communication_2020_1.general.webservices.netsuite.com" xmlns:faultsTypes="urn:types.faults_2020_1.platform.webservices.netsuite.com" xmlns:supportListsTypes="urn:types.support_2020_1.lists.webservices.netsuite.com" xmlns:websiteListsTypes="urn:types.website_2020_1.lists.webservices.netsuite.com" xmlns:purchasesTransactions="urn:purchases_2020_1.transactions.webservices.netsuite.com" xmlns:financialTransactionsTypes="urn:types.financial_2020_1.transactions.webservices.netsuite.com" xmlns:schedulingActivities="urn:scheduling_2020_1.activities.webservices.netsuite.com" xmlns:bankTransactions="urn:bank_2020_1.transactions.webservices.netsuite.com" xmlns:marketingLists="urn:marketing_2020_1.lists.webservices.netsuite.com" xmlns:customersTransactionsTypes="urn:types.customers_2020_1.transactions.webservices.netsuite.com" xmlns:purchasesTransactionsTypes="urn:types.purchases_2020_1.transactions.webservices.netsuite.com" xmlns:generalTransactions="urn:general_2020_1.transactions.webservices.netsuite.com" xmlns:filecabinetDocumentsTypes="urn:types.filecabinet_2020_1.documents.webservices.netsuite.com">
<soap:Header>
<urn:tokenPassport xmlns:urn="urn:messages_2020_1.platform.webservices.netsuite.com">
<ns8:account xmlns:ns8="urn:core_2020_1.platform.webservices.netsuite.com">XXX</ns8:account>
<ns8:consumerKey xmlns:ns8="urn:core_2020_1.platform.webservices.netsuite.com">XXX</ns8:consumerKey>
<ns8:token xmlns:ns8="urn:core_2020_1.platform.webservices.netsuite.com">XXX</ns8:token>
<ns8:nonce xmlns:ns8="urn:core_2020_1.platform.webservices.netsuite.com">XXX</ns8:nonce>
<ns8:timestamp xmlns:ns8="urn:core_2020_1.platform.webservices.netsuite.com">XXX</ns8:timestamp>
<ns8:signature xmlns:ns8="urn:core_2020_1.platform.webservices.netsuite.com" algorithm="HMAC_SHA256">XXX</ns8:signature>
</urn:tokenPassport>
<preferences xmlns="urn:messages_2020_1.platform.webservices.netsuite.com"/>
</soap:Header>
<soap:Body>
<add>
<record xmlns:salesTransactions="urn:sales_2020_1.transactions.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="salesTransactions:Invoice">
<itemList>
<item xsi:type="salesTransactions:InvoiceItem">
<orderLine xsi:type="salesTransactions:long">1</orderLine>
<quantity xsi:type="salesTransactions:double">1</quantity>
<rate xsi:type="salesTransactions:string">30000</rate>
<description xsi:type="salesTransactions:string">Annuity test</description>
</item>
</itemList>
<tranDate xsi:type="salesTransactions:dateTime">2020-09-09T00:00:00.000</tranDate>
<createdFrom xmlns:core="urn:core_2020_1.platform.webservices.netsuite.com" xsi:type="core:RecordRef" internalId="33202933"/>
<externalId xmlns:core="urn:core_2020_1.platform.webservices.netsuite.com" xsi:type="core:RecordRef">INV000089099</externalId>
</record>
</add>
</soap:Body>
</soap:Envelope>

Where are the links to each media file in a whatsapp database

I want to organize an album with all the photos from a Whatsapp group.
With a rooted phone I have downloaded the unencrypted whatsapp databases to my computer.
With Sqliteman on Ubuntu I've looked around, specially in the msgstore.db and can't seem to find all of the links to the images of a particular group.
With the table "chat_list" I saw that a specific "key_remote_jid" value corresponded to the group I wanted and in the "messages" database I could use that "key_remote_jid" to get all the messages related to that group with something like:
select * from messages where key_remote_jid="53151151515-1515131313535#g.us";
Furthermore I can discard text messages in order to focus on the media I want (Photos and Videos mainly) by
select * from messages where key_remote_jid="53151151515-1515131313535#g.us" and not media_wa_type = 0;
And some of the images there have a filename under the column "media_name" but they are only the ones I have sent.
There is another table called "media_refs" which contains many paths of images and video but seems to only include files which have been forwarded to more than one chat and has a key which I haven't found how to relate to the "messages" table.
The group is rather old (dating back to 2013) and it seems likely the way whatsapp handles its database has changed through the years as there are some columns which are consistently {null} in the past and not in the most recent messages (like participant_hash) and the value key_id seems to change the format at some point.
However the Whatsapp app has no problem in showing me the a file from any moment in the past and giving me the option to open the actual file with a "Gallery"-type software, so the information is in my phone somewhere.
The point of all this is to basically have a backup I can work with and be able to delete the images from my phone and still have them organized in the same way they were shared in that group.
I found the link of Whatsapp Images in column thumb_image of table messages as a blob. You can view the blob in hex and look for the the strings which may looks like this Whatsapp Images\IMG-20130101-WA0001.jpg. I don't know exactly where Whatsapp store the links properly, but this works for me.
Here is how I managed to extract the links:
select
_id,
media_mime_type,
substr(
substr(thumb_image,instr(thumb_image,'IMG'),60)
,instr(substr(thumb_image,instr(thumb_image,'IMG'),23),'IMG')
,23)
from `messages`
where
`key_remote_jid` like '%<your desired contact>%'
and `media_mime_type` like '%image%';
I use DB Browser for SQLite to do this in Windows.
(Android) - what one is looking for is file_path within the table message_media. It points to files relative to /sdcard/WhatsApp/ and its message_row_id references the messages table pk _id. A where condition on the key_remote_jid of the group (<..>#g.us) should output all group image filepaths.
select mm.file_path
from messages m
join message_media mm on m._id = mm.message_row_id
where m.key_remote_jid = 'xyz#g.us'
and m.media_wa_type = 1; -- 1 = images
(thumbnail previews are stored as blob bytes in raw_data in the messages table itself)

SilverPOP API - Automated message report

I need to export all data from Silverpop automated message with silverpop API
apparently there are no many information on the net apart from the official guide "XML API Developer’s Guide ENGAGE"
I need to know how to:
retrieve a list of Automated message
extract / download data of selected report (for all days-not single one)
finally (again not documented in the official guide); how to programmatically export final report having set MOVE_TO_FTP=true
(the guide quotes Use the MOVE_TO_FTP parameter to retrieve the output file programmatically)
thank you very much in advance for any help in this
You can use the RawRecipientDataExport XML API export to get the following:
• One or more mailings
• One or more Mailing/Report ID combinations (for Autoresponders)
• A specific Database (optional: include related queries)
• A specific Group of Automated Messages
• An Event Date Range
• A Mailing Date Range
For automated messages, you can use the following XML tags <CAMPAIGN_ACTIVE/>, <CAMPAIGN_COMPLETED/>, and <CAMPAIGN_CANCELLED/> to retrieve active Groups of Automated Messages, retrieve completed Groups of Automated Messages, and retrieve canceled Groups of Automated Messages, respectively.
To get data for all days and not just one, you can set a date range for send dates and event dates, by putting your desired date ranges within the <SEND_DATE_START> and <SEND_DATE_END> tags and <EVENT_DATE_START> and <EVENT_DATE_END> tags. The date formats are like this: 12/02/2011 23:59:00
Hope this helps.

How to match text in cmsplugin_text table to URL in Django CMS

We have created a site for a client using Django CMS and are approaching the launch date. There are a number of links to files on their old site. Doing a search of the cmsplugin_text table, I find 12 entries that contain the URL. There is no simple mapping to the new file download URL from the old download URL, so I need to find the pages these 12 entries appear on and tell our client so they can edit the page.
But the database is not easy to follow. So how do I go from the value of the cmsplugin_ptr_id column of the cmsplugin_text column to the URL of the page? I'm fairly sure that the cmsplugin_ptr_id is meant to line up with the id of the cms_cmsplugin table. That table also has parent_id, tree_id and placeholder_id, but I've kind of got lost at this point.
I'm happy to use either the database commands directly, or to use manage.py shell to do this.
Should have tried a bit harder before answering.
The steps that worked were to look in cms_page_placeholder for lines with the placeholder_id and look up the corresponding page_id. I could then look up the page in the admin at http://mysite.com/en/admin/cms/page/page_id and that page has a "View on site link".
The SQL statement I used was:
SELECT cpp.page_id
FROM cmsplugin_text AS cpt
LEFT JOIN cms_cmsplugin AS ccp ON cpt.cmsplugin_ptr_id = ccp.id
LEFT JOIN cms_page_placeholders AS cpp ON ccp.placeholder_id = cpp.placeholder_id
WHERE cpt.body like '%userfiles%';
Where userfiles was part of the path to the files on the old site.

How to aggregate files in Mule ESB CE

I need to aggregate a number of csv inbound files in-memory, if necessary resequencing them, on Mule ESB CE 3.2.1.
How could I implement this kind of logics?
I tried with message-chunking-aggregator-router, but it fails on startup because xsd schema does not admit such a configuration:
<message-chunking-aggregator-router timeout="20000" failOnTimeout="false" >
<expression-message-info-mapping correlationIdExpression="#[header:correlation]"/>
</message-chunking-aggregator-router>
I've also tried to attach mine correlation ids to inbound messages, then process them by a custom-aggregator, but I've found that Mule internally uses a key made up of:
Serializable key=event.getId()+event.getMessage().getCorrelationSequence();//EventGroup:264
The internal id is everytime different (also if correlation sequence is correct): this way, Mule does not use only correlation sequence as I expected and same message is processed many times.
Finally, I can re-write a custom aggregator, but I would like to use a more consolidated technique.
Thanks in advance,
Gabriele
UPDATE
I've tried with message-chunk-aggregator but it doesn't fit my requisite, as it admits duplicates.
I try to detail the scenario I need to cover:
Mule polls (on a SFTP location)
file 1 "FIXEDPREFIX_1_of_2.zip" is detected and kept in memory somewhere (as an open SFTPStream, it's ok).
Some correlation info are mantained for grouping: group, sequence, group size.
file 1 "FIXEDPREFIX_1_of_2.zip" is detected again, but cannot be inserted because would be duplicated
file 2 "FIXEDPREFIX_2_of_2.zip" is detected, and correctly added
stated that group size has been reached, Mule routes MessageCollection with the correct set of messages
About point 2., I'm lucky enough to get info from filename and put them into MuleMessage::correlation* properties, so that subsequent components could use them.
I did, but duplicates are processed the same.
Thanks again
Gabriele
Here is the right router to use with Mule 3: http://www.mulesoft.org/documentation/display/MULE3USER/Routing+Message+Processors#RoutingMessageProcessors-MessageChunkAggregator

Resources