Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added tip regarding colons in curl commands #348

Closed
wants to merge 1 commit into from
Closed

Conversation

csobier
Copy link
Contributor

@csobier csobier commented Dec 21, 2015

For docs issue#592

@michellechandra , can you confirm this Tip will help clarify with users? @iriberri , can you perhaps sign-off on this since Michelle is out for a few days?

@iriberri
Copy link

I'm not sure I like this approach. If we have to add the same note more than once in the same text perhaps it means there's something that we could be doing better there.

If you think the placeholders are not understandable, why don't convert them in anything that can be understood? (by itself).

@csobier
Copy link
Contributor Author

csobier commented Dec 22, 2015

I was just trying to add clarity since it caused some end-user misunderstanding. If you have a suggestion for better code examples, by all means, let me know!

@pnorman
Copy link
Contributor

pnorman commented Dec 31, 2015

If it's intended to signify something the user is supposed to replace with their own string, I'd suggest either or $TEMPLATE_NAME.

@csobier
Copy link
Contributor Author

csobier commented Jan 4, 2016

This is also in the docs (in the same MAPS API doc), @template_name. I also found other variations. This is opening up a bigger can of worms, since a lot of the doc is inconsistent in how we present these placeholders in examples.

Whether we suggest:
:template_name
or
<template_name>
or
$TEMPLATE_NAME

Note that many users will copy the code format literally, so whatever we show them must not cause errors. Ideally, the response would return an error if an incorrect symbol was used in the request, and display the reason. For example, "A placeholder : indicates that a user input value is required, please enter the actual value for the variable" @rochoa , could this be a possible feature enhancement?

@pnorman
Copy link
Contributor

pnorman commented Jan 4, 2016

In the URLs above the comments, there's at least two placeholders

https://documentation.cartodb.com/api/v1/map/named/:template_name/jsonp?auth_token=AUTH_TOKEN&callback=callback&config=template_params_json

Reading the text above, it looks like there are four placeholders: :template_name, AUTH_TOKEN, the second callback, and template_params_json.

 - **auth_token** optional, but required when `"method"` is set to `"token"`
 - **config** Encoded JSON with the params for creating named maps (the variables defined in the template)
 - **lmza** This attribute contains the same as config but LZMA compressed. It cannot be used at the same time than `config`.
 - **callback:** JSON callback name

@rochoa
Copy link
Contributor

rochoa commented Jan 12, 2016

So ... either:

  1. We create real examples for the documentation, so they can be copy-pasted.
  2. Or we define a proper way of defining placeholders across all documentation.

@michellechandra
Copy link

In the example API call, is "documentation" also technically a placeholder since the user would need to replace "documentation" with their username?

https://documentation.cartodb.com/api/v1/map/named/:template_name/jsonp?auth_token=AUTH_TOKEN&callback=callback&config=template_params_json

@csobier
Copy link
Contributor Author

csobier commented Jan 20, 2016

@rochoa , as per the Support team, most users copy and paste code. So if we are unable to generate errors indicating a placeholder value is undefined, we'll need real examples. *I'll need developer resources to step through each example with me and confirm.

Additionally, defining placeholders across all the API doc should be consistent as well. I'll just need the API repo owners to decide collaboratively what direction they want to go, so that we can kick-off a larger effort of cleaning up all the API code across all repos.

@pnorman pnorman closed this Jan 20, 2016
@pnorman pnorman reopened this Jan 20, 2016
@csobier
Copy link
Contributor Author

csobier commented Mar 17, 2016

Closing issue, replaced with new PR#403.

@csobier csobier closed this Mar 17, 2016
@csobier csobier deleted the 592-colon-url branch March 23, 2016 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants