How to get the Overall Categories, Sub Categories in Amazon MWS? - amazon-mws

Hi I'm started the web development in Amazon MWS. I need to integrate the get category list, add product, list product etc in my application. I have referred the documentation, http://docs.developer.amazonservices.com/en_IN/products/Products_Overview.html But, in that document there is no option to get all the categories, sub categories in mws. And also i have referred several sites, they told me to refer the Browse Tree Report in MWS Api. But, there is no section in the report section. Is Amazon MWS have something like "Get Categories" method, or is there any way to do this ?

For simple to use and explore checkout
https://www.browsenodes.com
It also has option to browse the categories for other countries.
Example for India the URL is
https://www.browsenodes.com/amazon.in

You can get the categories for a market place api by requesting Browse tree report. Each browse node( Amazon way of storing categories ) contains a field child_nodes which gives you information about the sub categories.
http://docs.developer.amazonservices.com/en_IN/reports/Reports_ReportType.html#ReportTypeCategories__BrowseTreeReports
If you are looking for the categories of individual product. Please refer
http://docs.developer.amazonservices.com/en_IN/products/Products_GetProductCategoriesForSKU.html
http://docs.developer.amazonservices.com/en_IN/products/Products_GetProductCategoriesForASIN.html

The Browse Tree Guide is an Excel file available for download from the Amazon Seller Central. Once logged in, go to Seller Central Help > Manage Inventory > Reference > Browse Tree Guide

I tried in amazon mws scratchpad and could get category information. (scratchpad website: https://mws.amazonservices.com.au/scratchpad/index.html) .
The process of getting categories:
API section Reports -> RequestReport (report type:_GET_MERCHANT_LISTINGS_DATA_, report option: _GET_XML_BROWSE_TREE_DATA_)
GetReportList(in this list, you may find ReportId related with '_GET_XML_BROWSE_TREE_DATA_' )
GetReport(use this ReportId as input).
Then you can get the tree report for all categories

Amazon does not make it easy to get all the categories, but I think what you are looking for is actually in AWS Browse Nodes.
http://docs.aws.amazon.com/AWSECommerceService/latest/DG/BrowseNodes.html

Maybe it's a little late but i wanted to answer the question so some other ones
find useful. First, you need to make a request to RequestReport action, after that, you will make a request to GetRequest action using previous action's id, this will give you a long list of the categories (for the marketplaces you specified in the query). This is the link to the action & service, and also don't forget to take a look at ReportTypes enums, you must define them correctli.
POST /Reports/2009-01-01 HTTP/1.1
Content-Type: x-www-form-urlencoded
Host: mws.amazonservices.com
User-Agent: <Your User Agent Header>
AWSAccessKeyId=0PB842EXAMPLE7N4ZTR2
&Action=RequestReport
&EndDate=2008-06-26T18%3A12%3A21
&MWSAuthToken=amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE
&Marketplace=ATVPDKIKX0DER
&ReportType=_GET_MERCHANT_LISTINGS_DATA_
&SellerId=A1XEXAMPLE5E6
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&StartDate=2009-01-03T18%3A12%3A21
&Timestamp=2009-02-04T18%3A12%3A21.687Z
&Version=2009-01-01
&Signature=ZQLpf8vEXAMPLE0iC265pf18n0%3D

► Option 1 :
Go To : https://sellercentral.amazon.com/gp/help/help.html/ref=au_1661_cont_help?ie=UTF8&itemID=1661&language=en_US
Log with your Amazon account ( even if you don't have seller user ).
Press on link : "Inventory File Templates and BTG" ( wait few seconds and it will download the file )
Print screen for Option 1
► Option 2 :
if you are looking for a CSV File that contains Amazon departments, categories, sub categories and their links ( based on : https://www.amazon.com/gp/site-directory ) , you may check also in this github repository : https://github.com/postme205/AmzCategoriesSubCategories/ or Here (github.io)

Related

MsGraph get users filter to get only person account

Is there a way to list users and filter only real person account using MsGraph users API ?https://graph.microsoft.com/v1.0/users
Currently, it returns person but also conference rooms and others.
I see that you can retrieve persons you work with using people API:
https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/people?$filter=personType/class eq 'Person' and personType/subclass eq 'OrganizationUser'
Is there anything similar for users ?
Thanks you !
The current options are to either use the People API like you said or the List orgContacts endpoint from the Microsoft Graph Rest API Beta.
GET https://graph.microsoft.com/beta/contacts
This returns the list of organizational contacts for the organization.

Serve multiple PayPal sellers from the same website

I have a website that does ticket sales. This website uses PayPal to process the payments. More specifically, I am using ExpressCheckout to process payments.
I have two sellers right now, and I cannot get them to both work at the same time.
Their sites are:
myapp.appspot.com/SellerA
myapp.appspot.com/SellerB
I have separate PayPal signature credentials for each seller in different config files:
acct1.UserName = sellera_api1.comcast.net
acct1.Password = <passwordA>
acct1.Signature = <signatureA>
acct1.UserName = sellerb_api1.comcast.net
acct1.Password = <passwordB>
acct1.Signature = <signatureB>
Here is the frustrating workflow that I am encountering:
1) Seller A works just fine, Seller B gets this error:
com.paypal.exception.InvalidCredentialException: Invalid userIdsellerb_api1.comcast.net
2) request new signature credentials for seller B and paste them into seller B's config file
3) Seller B works just fine, Seller A gets this error:
com.paypal.exception.InvalidCredentialException: Invalid userIdsellera_api1.comcast.net
4) request new signature credentials for seller A and paste them into seller A's config file
5) back to step 1
Any idea what could be happening here and how to fix this problem?
You might have to set them as two different accounts (like below) so that you make different API calls based on API user.
acct1.Username = sellera_api1.comcast.net
acct2.Username = sellerb_api1.comcast.net
Then you could call
setExpressCheckout(SetExpressCheckoutReq setExpressCheckoutReq, String apiUsername)
This probably not the best way to solve it and so I am very interested to see other solutions.

Using the API to get google directory contacts

I am a Google Apps customer and want to use the Contact API to search for a user in the company directory.
I am able to access contacts using for example:
feed = gd_client.GetContacts()
However the contacts this returns is only a subset of my contacts and is not those in the company directory.
Has anyone had experience of this or give me any pointers.
I think what you are looking for is the Domain Shared Contact API instead of the Contact API. Check this out (https://developers.google.com/google-apps/domain-shared-contacts/)
Try to run the get request against the domain, you should be able to retrieve your directory contacts instead of personal contacts (https://developers.google.com/admin-sdk/domain-shared-contacts/#Retrieving)
Try using Query to get result feed. You can specify max results to get in query. This way your result feed will be returned with more contacts in other groups as well.
URL FeedURL = new URL("https://www.google.com/m8/feeds/contacts/default/full");
Query MyQuery = new Query(FeedURL);
MyQuery.setMaxResults(200);
ContactFeed ResultFeed = MyService.query(MyQuery, ContactFeed.class);

way to script an export of all AD users vcards

i'm looking for an easy way to export all active directory users info into unique vcards for each. there is some info i'd like to leave out of the vcard like home phone, and emergency contact. i've looked around the web and have little luck finding anything. any help would be appreciated.
I doubt there will be a very easy way. Ultimately, you need to
enumerate all your users (or a subset therefore)
iterate over the resulting list of users
export each user's data to a VCard
For the searching & iterating part, you can use a PrincipalSearcher to do your searching:
// create your domain context
using (PrincipalContext ctx = new PrincipalContext(ContextType.Domain))
{
// define a "query-by-example" principal - here, we search for a UserPrincipal
// this "QBE" user would give you the ability to further limit what you get back
// as results from the searcher
UserPrincipal qbeUser = new UserPrincipal(ctx);
// create your principal searcher passing in the QBE principal
PrincipalSearcher srch = new PrincipalSearcher(qbeUser);
// find all matches
foreach(var found in srch.FindAll())
{
UserPrincipal foundUser = found as UserPrincipal;
if(foundUser != null)
{
ExportToVCard(foundUser);
}
}
}
And now all that's left to do is create the ExportToVCard function :-) See e.g. this blog post with code samples and further links for help.
If you haven't already - absolutely read the MSDN article Managing Directory Security Principals in the .NET Framework 3.5 which shows nicely how to make the best use of the new features in System.DirectoryServices.AccountManagement. Or see the MSDN documentation on the System.DirectoryServices.AccountManagement namespace.
If you just want the data itself, I would take a look at Softerra's free LDAP Browser, found here.
Setup a profile for your directory server - once it's connected in the browser, you'll see the default schema for the BaseDN you've provided during the initial setup. On the server icon, right click, and hit "Export Data".
The export wizard will walk you through most of the process, but the important part is Step 3. If you want to find all users, just set your search filter to (objectClass=user), make sure your search scope is SubTree, and then then edit what attributes you want to return.
You'll have to process the results into VCards, but this is the easiest\fastest way of getting all the users and attributes that you want.

Why can't I update these custom fields in Salesforce?

Greetings,
Well I am bewildered. I have been tasked with updating a PHP script that uses the BulkAPI to upsert some data into the Opportunity entity.
This is all going well except that the Bulk API is returning this error for some clearly defined custom fields:
InvalidBatch : Field name not found : cv__Acknowledged__c
And similar.
I thought I finally found the problem when I discovered the WSDL version I was using was quite old (Partner WSDL). So I promptly regenerated the WSDL. Only problem? Enterprise, Partner, etc....all of them...do not include these fields. They're all coming from the Common Ground package and start with cv_
I even tried to find them in the object explorer in Workbench as well as the schema explorer in Force.com IDE.
So, please...lend me your experience. How can I update these values?
Thanks in advance!
Clif
Screenshots to prove I have the correct access:
EDIT -- Here is my code:
require_once 'soapclient/SforcePartnerClient.php';
require_once 'BulkApiClient.php';
$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection(APP.'plugins'.DS.'salesforce_bulk_api_client'.DS.'vendors'.DS.'soapclient'.DS.'partner.wsdl.xml');
$mylogin = $mySforceConnection->login('redacted#redacted.com', 'redactedSessionredactedPassword');
$myBulkApiConnection = new BulkApiClient($mylogin->serverUrl, $mylogin->sessionId);
$job = new JobInfo();
$job->setObject('Opportunity');
$job->setOpertion('upsert');
$job->setContentType('CSV');
$job->setConcurrencyMode('Parallel');
$job->setExternalIdFieldName('Id');
$job = $myBulkApiConnection->createJob($job);
$batch = $myBulkApiConnection->createBatch($job, $insert);
$myBulkApiConnection->updateJobState($job->getId(), 'Closed');
$times = 1;
while($batch->getState() == 'Queued' || $batch->getState() == 'InProgress')
{
$batch = $myBulkApiConnection->getBatchInfo($job->getId(), $batch->getId());
sleep(pow(1.5, $times++));
}
$batchResults = $myBulkApiConnection->getBatchResults($job->getId(), $batch->getId());
echo "Number of records processed: " . $batch->getNumberRecordsProcessed() . "\n";
echo "Number of records failed: " . $batch->getNumberRecordsFailed() . "\n";
echo "stateMessage: " . $batch->getStateMessage() . "\n";
if($batch->getNumberRecordsFailed() > 0 || $batch->getNumberRecordsFailed() == $batch->getNumberRecordsProcessed())
{
echo "Failures detected. Batch results:\n".$batchResults."\nEnd batch.\n";
}
And lastly, an example of the CSV data being sent:
"Id","AccountId","Amount","CampaignId","CloseDate","Name","OwnerId","RecordTypeId","StageName","Type","cv__Acknowledged__c","cv__Payment_Type__c","ER_Acknowledgment_Type__c"
"#N/A","0018000000nH16fAAC","100.00","70180000000nktJ","2010-10-29","Gary Smith $100.00 Single Donation 10/29/2010","00580000001jWnq","01280000000F7c7AAC","Received","Individual Gift","Not Acknowledged","Credit Card","Email"
"#N/A","0018000000nH1JtAAK","30.00","70180000000nktJ","2010-12-20","Lisa Smith $30.00 Single Donation 12/20/2010","00580000001jWnq","01280000000F7c7AAC","Received","Individual Gift","Not Acknowledged","Credit Card","Email"
After 2 weeks, 4 cases, dozens of e-mails and phone calls, 3 bulletin board posts, and 1 Stackoverflow question, I finally got a solution.
The problem was quite simple in the end. (which makes all of that all the more frustrating)
As stated, the custom fields I was trying to update live in the Convio Common Ground package. Apparently our install has 2 licenses for this package. None of the licenses were assigned to my user account.
It isn't clear what is really gained/lost by not having the license other than API access. As the rest of this thread demonstrates, I was able to see and update the fields in every other way.
If you run into this, you can view the licenses on the Manage Packages page in Setup. Drill through to the package in question and it should list the users who are licensed to use it.
Thanks to SimonF's professional and timely assistance on the Developer Force bulletin boards:
http://boards.developerforce.com/t5/Perl-PHP-Python-Ruby-Development/Bulk-API-So-frustrated/m-p/232473/highlight/false#M4713
I really think this is a field level security issue. Is the field included in the opportunity layout for that user profile? Field level security picks the most restrictive option, so if you seem to have access from the setup screen but it's not included in the layout, I don't think the system will give you access.
If you're certain that your user's profile has FLS access to the fields and the assigned layouts include the fields, then I'd suggest looking into the definition of the package in question. I know the bulk API allows use of fields in managed packages normally (I've done this).
My best guess at this point is that your org has installed multiple versions of this package over time. Through component deprecation, it's possible the package author deprecated these custom fields. Take a look at two places once you've logged into salesforce:
1.) The package definition page. It should have details about what package version was used when the package was first installed and what package version you're at now.
2.) The page that has WSDL generation links. If you choose to generate the enterprise WSDL, you should be taken to a page that has dropdown elements that let you select which package version to use. Try fiddling with those to see if you can get the fields to show up.
These are just guesses. If you find more info, let me know, and I can try to provide additional guidance.

Resources