balanced / balanced-api

Balanced API specification.
220 stars 72 forks source link

uri format difference between credit cards and credits #606

Closed ebfg closed 7 years ago

ebfg commented 10 years ago

When we create a credit card, the response includes a uri field of the form /v1/marketplaces/MP-XXXX/cards/.... We can use this to link directly to the balanced dashboard entry for the card. Same for debits (/v1/marketplaces/MP-XXXX/debits/....)

However, when we create credits, the returned uri is of the form /v1/credits/...., so to link to the dashboard, we'd have to mangle the url to include the marketplace.

Why is this and can it be changed to match the other uri formats?

steveklabnik commented 10 years ago

Those are version 1.0 URLs, and version 1.0 is frozen, so yes, it won't be changing.

You'll probably find 1.1 to be significantly more regular.

ebfg commented 10 years ago

Hmm, we're using the latest balanced-ruby gem. Shouldn't that be using 1.1?

ebfg commented 10 years ago

Is it because we're specifying our marketplace URI as /v1/...?

steveklabnik commented 10 years ago

Yes, the latest should be 1.1.

Is it because we're specifying our marketplace URI as /v1/...?

Quite possibly. Can you try it as just /marketplaces/:id?

matthewfl commented 10 years ago

@ebfg are you still experiencing this issue? Also note in rev1.0 while there are different urls that the resources can be accessed at, preforming a get request with any of them should work. Also as Steve noted, if you are using the latest version of the api (rev1.1) then many of the urls have been cleaned up and are now consistent.