detroitledger / gnl_profile

API & data management system for the Detroit Ledger
https://www.detroitledger.org
0 stars 2 forks source link

Include NTEE endpoint #113

Open hampelm opened 9 years ago

hampelm commented 9 years ago

It'd be helpful to have an API endpoint for listing all NTEEs that have orgs (or just all NTEEs) so we can allow searching by nonprofit sector

bnchdrff commented 9 years ago

http://docs.detroitledger.apiary.io/#ntee

it lists all possible NTEES and provides an array org_ids containing organization id #s or optionally orgs containing fully-loaded organization entities.

hampelm commented 9 years ago

I just went to look at the status of this issue and saw you implemented it... 3 minutes ago :-)

bnchdrff commented 9 years ago

mind meld

bnchdrff commented 9 years ago

haven't added an ntees/:id endpoint yet, but will do that later today... unfortunately apiary doesn't show the example data unless you have that endpoint. kinda silly. anyways you can see the sample data here: https://github.com/detroitledger/gnl_profile/blob/7.x-1.x/apiary.apib#L284

hampelm commented 9 years ago

Sweet! How hard would it be to add an received and funded sum to the ntees without loading the orgs? Use case I'm thinking of is showing the size of various sectors.

bnchdrff commented 9 years ago

that is doable!

bnchdrff commented 9 years ago

added totals property to each ntee -- this only happens when you load_orgs (gotta load em to get the individual totals, anyways... if performance is a problem i can do some cachery)

hampelm commented 9 years ago

Adding a request for /ntee/:id when you've got a breather from other work.

Ideally, we'd also have an endpoint for /ntee/:[human readable tag name] or anything that lets me query by human-readable name. That'd make human-readable (and therefore google-friendly) URLs straightforward.

bnchdrff commented 9 years ago

ntees/:id is active now!

regarding human-readable names... what should we do about overlapping names, and hierarchy of ntee code names in general? maybe we can do the ntee code itself instead of the name? e.g. A84 for https://data.detroitledger.org/api/1.0/ntees/1176.json

hampelm commented 9 years ago

Hm. Would be best to have the name so that we don't have to look elsewhere for it. Could we have a reference to the parent?

Or we could have a hybrid format of {Code} + {Name} eg A84 Computer API Development Services.

bnchdrff commented 9 years ago

I don't understand what the use case is, here... we can't have a frontend URL that differs from the API request(s) it makes to build the page?

hampelm commented 9 years ago

Oh sorry! I misinterpreted the question. The goal is to have SEO & human-friendly URL slugs on the front-end (eg !/organizations/type/human-services). We'd need some way of going from human-readable slug to endpoint.