No Item quantity in /v1/loc/items and missing useful data in /v1/loc/inventory - square-connect

I'm trying to have a google sheet sync inventory.
Importing https://connect.squareup.com/v1/(location)/items, it doesn't include the item's quantity, even though it includes almost everything else
If I import https://connect.squareup.com/v1/(location)/inventory it shows quantities but only for variation Ids, and no item names.
Does anyone know how to get an item library INCLUDING the product name?
PS -
I would ideally like to import the output of the item library export. The link for that is:
https://squareup.com/api/v3/items-bulk/export
I'm guessing this may be an option in API v3 later...

You would have to match up the inventory and parent items yourself. Square is working on updated inventory and item management endpoints for the v2 APIs, so be on the lookout for those!

Related

How do I get a count of the Shopify products in a collection using the Ruby API

I want to get the count of products in each collection in the shop as part of a Shopify App that I'm building.
I know that for a single collection Product.all(params: {collection_id: 29238895}).count will show me the count in the shopify console, but I'm not certain about how it is implemented.
The API document describes a call that counts all products that belong to a certain collection GET /admin/products/count.json?collection_id=841564295 but I have been unable to get a ruby expression that runs this.
Is there a more complete document on the Ruby API?
If you want to know exactly what is going on with the API, may I suggest the simple command: bundle open shopify_api
That will load the entire API into your text editor, allowing to quickly determine the answer to your question. The /lib/resources directory is especially rich, but do not forget to check the base class as well. In fact, I think the count option is declared right in the base itself. Nothing beats a few minutes of examining the code.

How can I get a list of all CSGO items including skin name, quality and rarity?

I'm not looking for details of a specific player inventory, but a list of all items for CSGO. What I want is details of the weapons in particular, but including skin name information and rarity.
To make it easier to explain this site has the information I need, except rarity.
http://csgo.steamanalyst.com/list.php
By using the following api url I can get weapon model names but not skin names (ie. "Zirka")
http://api.steampowered.com/IEconItems_730/GetSchema/v0002/?key={YOUR_API_KEY}
I haven't found anything regarding skins in Steam Web Api.
Lists of all skins as well as rarity and corresponding weapons are in "paint_kits", "paint_kits_rarity" and "item_sets" sections of /csgo/scripts/items/items_game.txt file.
As for their correct names, those are in /csgo/resource/csgo_YOUR_LANGUAGE.txt. Looking like that
"PaintKit_so_red_Tag" "Candy Apple"
Won't be hard to make php or python script to get all of it and put it in a database for ease of use.
For skins images you could get weapon and skin name from the above, and do a foreach curl loop to get content from div with "market_listing_largeimage" class using for example simple_html_dom.php, from url http://steamcommunity.com/market/listings/730/{ITEM_NAME}%20%7C%20{SKIN_NAME}%20%28{USAGE_THINGY Ex. Well-Worn}%29
Just remember to replace all spaces going to the url with %20 but that depends on what you use to get the page. You could do a foreach on the usage thingy since some weapons don't have some variants on the market, curl could return wrong page. Nothing that a simple if+foreach couldn't fix.
Also do it only after skins update if overused you could get blocked from valve website for spamming. You could also use SteamWebApi and game news to check for new versions and update it automatically then. Just use your imagination and google.

Sitefinity: Where can I find the master GUID for a content item?

I'm building a web service for a client that pulls data from the Sitefinity CMS. The problem is they want to pass in a Guid for the service and receive the info about this item. No problem except I only have been able to locate the "live" Guid for one Item (and that was by combing through the HTML in the back end).
I was going to look at the tables in SQL Server but I'm not sure which table to look at. The content items have several tables all related of course and there isn't any documentation on how to look at this. I can find plenty of documentation on querying the master Guid, but no place to find it.
Oh, and these are custom content types built by the Module Builder.
Any Help would be SOOOOO appreciated!
var master = DynamicModuleManager.GetManager().Lifecycle.GetMaster(<liveGuidHere>);
One of the biggest consumers of Sitefinity webservices is Sitefinity. The best place to start looking for that guid is to take a look at what web service calls are being made when you pull up your custom content item list in the backend. I used the chrome developer tools and check in the network tab.
One I found for a stores module made with module builder was something to the effect of http://www.testsite.com/Sitefinity/Services/DynamicModules/Data.svc/?managerType=Telerik.Sitefinity.DynamicModules.DynamicModuleManager&providerName=OpenAccessProvider&itemType=Telerik.Sitefinity.DynamicTypes.Model.Stores.Store&provider=OpenAccessProvider&sortExpression=LastModified%20DESC&skip=0&take=50
The json this returns is a list of all the masters with their ids (note in the list that the content items all have have a status of 0) http://www.sitefinity.com/documentation/documentationarticles/developers-guide/sitefinity-essentials/modules/content-lifecycle
When you go to Administration / Module Builder / Your Module, you will see a link to the API on the top right corner.
This link goes to a page full of API examples for your particular module which is kind of cool.
Basically you would have to find your item first using LINQ and the GetValue extension method.
Once you have the item you can get its ID or any other property.
using Telerik.Sitefinity.Utilities.TypeConverters;
using Telerik.Sitefinity.DynamicModules;
using Telerik.Sitefinity.Model;
....
var mgr = DynamicModuleManager.GetManager();
var countrymasters = from ctry in mgr.GetDataItems(TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.Destinations.Destination"))
where ctry.GetValue<string>("culture") == siteid &&
(ctry.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ctry.Visible == true)
select new
{
airport_cd = ctry.GetValue<string>("airport_cd"),
country_master_cd = ctry.GetValue<string>("country_master_cd")
};

Sitecore global url to specific url

Currently I am facing the following problem:
A website, which I have to make for a company, has different locations. But the content of a few pages is for all locations the same. Now I have created a global folder with the items for all the locations. But now I am facing the following problem: when accessing the global items from the website of a specific location I get the global url. But what I want is that the specific location url remains the same structure, for example:
Now it is www.url.com/global/subfolder/itemname
And what I want is www.url.com/location1/subfolder/itemname
Does anybody have any solution(s)/suggestion(s) for this problem?
Does anybody also have a solution for creating a menu to insert these global items but also to insert the location specific items?
Some more information about my Sitecore content structure
Global: contains the global items for alle locations
Corporate: the corporate website of the company
Location1: the website of location1
Location2: the website of location2
Adam Weber was right, cloning is your best solution:
Create your Global section, with all the child items you need
For each of your local sections, clone the global section and place it where you'd like it to appear within your local menu
If I understand you correctly, this is what I'd do. It might not be the prettiest solution. But it'll work.
You have your "data" items in /global/subfolder/itemname
then just create some templates, which are "dummy" pages, that only contain a link to the global item (and perhaps the few fields that could differ (perhaps contact email for the specifik location).
Then you make a sublayout that bascially jsut gets the referenced item and uses that instead of Sitecore.Context.Item.
Then create an instance of the "dummy" template in /location1/subfolder/itemname and reference it to /global/subfolder/itemname
That way you URLs will be correct and the data will be the same.
Another and probably smarter solution (if you have enabled proxies) is to create a proxy that takes
/global/subfolder/itemname as source and points to /location1/subfolder/ as target (or you could take /global/subfolder and check "include children".
Here is a Guide on how to use proxies in 5.3:
http://sdn.sitecore.net/Articles/Administration/Using%20Proxy%20Items%20in%205,-d-,3.aspx

how to add more simple products into configurable products using magento API

How can I simply add new simple products incrementally to configurable products?
or do I still need to retrieve the 2 original arrays of the pre-defined configurable product (getConfigurableAttributesData and getConfigurableProductsData) first, append the new arrays and set them again? Is it worked for my case just as the first-time creation?
And if the new simple product owns a new attribute / attribute options, do I also need to create /edit the attribute first before adding?
Thanks in advance!
The API as it stands does not have the functionality to do this.
Your options are:
Extend the API. (Hours of fun)
Do it with Magento methods in your own module or standalone code that includes Mage.php.
SQL script mixed in with your existing API code.
Buy someone's module - (Hope your German is good)
The approach you take also depends on your SKU naming scheme, if you have a simple BASECODE-SIZE-COLOUR type of scheme then the SQL option can work a treat, and in next to no time, but will be heavily scorned on by Magento evangelists.
That means you are probably going to have to write your own code. Here is a very useful site that should help get you started:
http://www.ayasoftware.com/
As well as being able to import configurables (by a variety of means including SQL) there are also snippets of code useful for updating superattribute price differentials. No readymade complete solution, but, you may need to roll your own anyway depending on your SKU naming scheme.
Whilst you are at it you may also want to write some code to find simple products that are not hooked up to anything when they should be, i,e. the ones with no visibility.

Resources