HashtagSell / posting-api

API for storage and retrieval of posting details for Hashtagsell
0 stars 0 forks source link

Cannot lookup grouping category #46

Closed that1guy closed 9 years ago

that1guy commented 9 years ago
Query
http://localhost:4043/v1/groupings?code=SELE
Response is showing all categories unlike documentation suggests.
{
  "options": {
    "count": 100,
    "filters": {},
    "sort": {},
    "start": 0
  },
  "results": [
    {
      "code": "AAAA",
      "name": "animals",
      "categories": [
        {
          "code": "APET",
          "name": "pets"
        },
        {
          "code": "ASUP",
          "name": "supplies"
        },
        {
          "code": "AOTH",
          "name": "other"
        }
      ]
    },
    {
      "code": "CCCC",
      "name": "community",
      "categories": [
        {
          "code": "CCNW",
          "name": "classes and workshops"
        },
        {
          "code": "COMM",
          "name": "events"
        },
        {
          "code": "CGRP",
          "name": "groups"
        },
        {
          "code": "CLNF",
          "name": "lost and found"
        },
        {
          "code": "CRID",
          "name": "rideshares"
        },
        {
          "code": "CVOL",
          "name": "volunteers"
        },
        {
          "code": "COTH",
          "name": "other"
        }
      ]
    },
    {
      "code": "DISP",
      "name": "dispatch",
      "categories": [
        {
          "code": "DDEL",
          "name": "delivery"
        },
        {
          "code": "DISP",
          "name": "dispatch"
        },
        {
          "code": "DTAX",
          "name": "taxi"
        },
        {
          "code": "DTOW",
          "name": "tow"
        }
      ]
    },
    {
      "code": "SSSS",
      "name": "for sale",
      "categories": [
        {
          "code": "SANT",
          "name": "antiques"
        },
        {
          "code": "SAPP",
          "name": "apparel"
        },
        {
          "code": "SAPL",
          "name": "appliances"
        },
        {
          "code": "SANC",
          "name": "art and crafts"
        },
        {
          "code": "SKID",
          "name": "babies and kids"
        },
        {
          "code": "SBAR",
          "name": "barters"
        },
        {
          "code": "SBIK",
          "name": "bicycles"
        },
        {
          "code": "SBIZ",
          "name": "businesses"
        },
        {
          "code": "SCOL",
          "name": "collections"
        },
        {
          "code": "SEDU",
          "name": "educational"
        },
        {
          "code": "SELE",
          "name": "electronics and photo"
        },
        {
          "code": "SFNB",
          "name": "food and beverage"
        },
        {
          "code": "SFUR",
          "name": "furniture"
        },
        {
          "code": "SGAR",
          "name": "garage sales"
        },
        {
          "code": "SGFT",
          "name": "gift cards"
        },
        {
          "code": "SHNB",
          "name": "health and beauty"
        },
        {
          "code": "SHNG",
          "name": "home and garden"
        },
        {
          "code": "SIND",
          "name": "industrial"
        },
        {
          "code": "SJWL",
          "name": "jewelry"
        },
        {
          "code": "SLIT",
          "name": "literature"
        },
        {
          "code": "SMNM",
          "name": "movies and music"
        },
        {
          "code": "SMUS",
          "name": "musical instruments"
        },
        {
          "code": "SRES",
          "name": "restaurants"
        },
        {
          "code": "SSNF",
          "name": "sports and fitness"
        },
        {
          "code": "STIX",
          "name": "tickets"
        },
        {
          "code": "STOO",
          "name": "tools"
        },
        {
          "code": "STOY",
          "name": "toys and hobbies"
        },
        {
          "code": "STVL",
          "name": "travel"
        },
        {
          "code": "SWNT",
          "name": "wanted"
        },
        {
          "code": "SOTH",
          "name": "other"
        }
      ]
    },
    {
      "code": "MMMM",
      "name": "mature",
      "categories": [
        {
          "code": "MESC",
          "name": "escorts"
        },
        {
          "code": "MFET",
          "name": "fetish"
        },
        {
          "code": "MJOB",
          "name": "jobs"
        },
        {
          "code": "MMSG",
          "name": "massage"
        },
        {
          "code": "MPNW",
          "name": "phone and websites"
        },
        {
          "code": "MSTR",
          "name": "strippers"
        },
        {
          "code": "MOTH",
          "name": "other"
        }
      ]
    },
    {
      "code": "PPPP",
      "name": "personals",
      "categories": [
        {
          "code": "PMSM",
          "name": "men seeking men"
        },
        {
          "code": "PMSW",
          "name": "men seeking women"
        },
        {
          "code": "PWSM",
          "name": "women seeking men"
        },
        {
          "code": "PWSW",
          "name": "women seeking women"
        },
        {
          "code": "POTH",
          "name": "other"
        }
      ]
    },
    {
      "code": "RRRR",
      "name": "real estate",
      "categories": [
        {
          "code": "RCRE",
          "name": "commercial real estate"
        },
        {
          "code": "RHFR",
          "name": "housing for rent"
        },
        {
          "code": "RHFS",
          "name": "housing for sale"
        },
        {
          "code": "RSUB",
          "name": "housing sublets"
        },
        {
          "code": "RSWP",
          "name": "housing swaps"
        },
        {
          "code": "RLOT",
          "name": "lots and land"
        },
        {
          "code": "RPNS",
          "name": "parking and storage"
        },
        {
          "code": "RSHR",
          "name": "room shares"
        },
        {
          "code": "RVAC",
          "name": "vacation properties"
        },
        {
          "code": "RWNT",
          "name": "want housing"
        },
        {
          "code": "ROTH",
          "name": "other"
        }
      ]
    },
    {
      "code": "SVCS",
      "name": "services",
      "categories": [
        {
          "code": "SVCC",
          "name": "creative"
        },
        {
          "code": "SVCE",
          "name": "education"
        },
        {
          "code": "SVCF",
          "name": "financial"
        },
        {
          "code": "SVCM",
          "name": "health"
        },
        {
          "code": "SVCH",
          "name": "household"
        },
        {
          "code": "SVCP",
          "name": "professional"
        },
        {
          "code": "SVCO",
          "name": "other"
        }
      ]
    },
    {
      "code": "ZZZZ",
      "name": "uncategorized",
      "categories": [
        {
          "code": "ZOTH",
          "name": "other"
        }
      ]
    },
    {
      "code": "VVVV",
      "name": "vehicles",
      "categories": [
        {
          "code": "VAUT",
          "name": "autos"
        },
        {
          "code": "VMOT",
          "name": "motorcycles"
        },
        {
          "code": "VMPT",
          "name": "motorcycle parts"
        },
        {
          "code": "VPAR",
          "name": "parts"
        },
        {
          "code": "VOTH",
          "name": "other"
        }
      ]
    },
    {
      "code": "JJJJ",
      "name": "jobs",
      "categories": [
        {
          "code": "JACC",
          "name": "accounting"
        },
        {
          "code": "JADM",
          "name": "administrative"
        },
        {
          "code": "JAER",
          "name": "aerospace and defense"
        },
        {
          "code": "JANL",
          "name": "analyst"
        },
        {
          "code": "JANA",
          "name": "animals and agriculture"
        },
        {
          "code": "JARC",
          "name": "architecture"
        },
        {
          "code": "JART",
          "name": "art"
        },
        {
          "code": "JAUT",
          "name": "automobile"
        },
        {
          "code": "JBEA",
          "name": "beauty"
        },
        {
          "code": "JBIZ",
          "name": "business development"
        },
        {
          "code": "JWEB",
          "name": "computer and web"
        },
        {
          "code": "JCST",
          "name": "construction and facilities"
        },
        {
          "code": "JCON",
          "name": "consulting"
        },
        {
          "code": "JCUS",
          "name": "customer service"
        },
        {
          "code": "JDES",
          "name": "design"
        },
        {
          "code": "JEDU",
          "name": "education"
        },
        {
          "code": "JENE",
          "name": "energy"
        },
        {
          "code": "JENG",
          "name": "engineering"
        },
        {
          "code": "JENT",
          "name": "entertainment and media"
        },
        {
          "code": "JEVE",
          "name": "events"
        },
        {
          "code": "JFIN",
          "name": "finance"
        },
        {
          "code": "JFNB",
          "name": "food and beverage"
        },
        {
          "code": "JGIG",
          "name": "gigs"
        },
        {
          "code": "JGOV",
          "name": "government"
        },
        {
          "code": "JHEA",
          "name": "healthcare"
        },
        {
          "code": "JHOS",
          "name": "hospitality and travel"
        },
        {
          "code": "JHUM",
          "name": "human resources"
        },
        {
          "code": "JMNT",
          "name": "installation, maintenance and repair"
        },
        {
          "code": "JINS",
          "name": "insurance"
        },
        {
          "code": "JINT",
          "name": "international"
        },
        {
          "code": "JLAW",
          "name": "law enforcement"
        },
        {
          "code": "JLEG",
          "name": "legal"
        },
        {
          "code": "JMAN",
          "name": "management and directorship"
        },
        {
          "code": "JMFT",
          "name": "manufacturing and mechanical"
        },
        {
          "code": "JMAR",
          "name": "marketing, advertising and public relations"
        },
        {
          "code": "JNON",
          "name": "non-profit"
        },
        {
          "code": "JOPS",
          "name": "operations and logistics"
        },
        {
          "code": "JPHA",
          "name": "pharmaceutical"
        },
        {
          "code": "JPRO",
          "name": "product, project and program management"
        },
        {
          "code": "JPUR",
          "name": "purchasing"
        },
        {
          "code": "JQUA",
          "name": "quality assurance"
        },
        {
          "code": "JREA",
          "name": "real estate"
        },
        {
          "code": "JREC",
          "name": "recreation"
        },
        {
          "code": "JRES",
          "name": "resumes"
        },
        {
          "code": "JRNW",
          "name": "retail and wholesale"
        },
        {
          "code": "JSAL",
          "name": "sales"
        },
        {
          "code": "JSCI",
          "name": "science"
        },
        {
          "code": "JSEC",
          "name": "security"
        },
        {
          "code": "JSKL",
          "name": "skilled trade and general labor"
        },
        {
          "code": "JTEL",
          "name": "telecommunications"
        },
        {
          "code": "JTRA",
          "name": "transportation"
        },
        {
          "code": "JVOL",
          "name": "volunteer"
        },
        {
          "code": "JWNP",
          "name": "writing and publishing"
        },
        {
          "code": "JOTH",
          "name": "other"
        }
      ]
    }
  ],
  "total": 11
}
brozeph commented 9 years ago

The grouping lookup specifies the grouping in the URL, but not supplied via query string: https://staging-posting-api.hashtagsell.com/v1/groupings/<code_goes_here> (see docs: https://staging-posting-api.hashtagsell.com/v1/docs#groupings-groupings)

The challenge here is that you are using a sub grouping (SELE) - those are not returned from the API at this time, only the top level groupings are.

Changing tag to enhancement and will implement code to return sub-categories as well.

brozeph commented 9 years ago

Implemented fix - when a sub-category is supplied in the URL, the sub-category and grouping are both returned:

https://staging-posting-api.hashtagsell.com/v1/groupings/SELE

{
  "code": "SSSS",
  "name": "for sale",
  "categories": [
    {
      "code": "SELE",
      "name": "electronics and photo"
    }
  ]
}