APIDOCJS - Adding line break into Description - api-doc

I would like to add a line break into the description. But I cannot find the proper syntax for it.
What I want to achieve is all these 3 #apiError will combine under the same component.
#apiError [(group)] [{type}] field [description]
#apiError {String} 400 1 or more parameters is empty.
#apiError {String} 400 Your account is suspended.
#apiError {String} 400 Your account not found.
Reference: http://apidocjs.com/#param-api-error
Maybe tricks like this will do, but I am not testing it yet.
#apiError {String} 400 1 or more parameters is empty. <br> Your account is suspended. <br> Your account not found.
Thanks.

Update.. this syntax works.
#apiError {String} 400 1 or more parameters is empty <br> Your account is suspended <br> Your account not found.

Related

What does this Google API error message mean?

Imagine you call an API to get an in-app purchase details. It has 3 params: package name (de facto app ID), product ID and a purchase token.
You get the following response: HTTP 400 Invalid Value with JSON body like this:
[{'message': 'Invalid Value', 'domain': 'global', 'reason': 'invalid'}]
Is your package name invalid? Is your product ID invalid? Or is your purchase token invalid?
Hint: all of the values you passed are valid.
Question: what is wrong?
Answer: you're calling an incorrect API method. The purchase was not a product, it was a subscription.
I've wrote a ton of APIs myself and I would never ever return a HTTP 400 with such confusing output.
Google, you can do better.

Using renewAuth fails with invalid_token "audience is not valid"

I am following along with the instructions to renew a token at
https://auth0.com/docs/quickstart/spa/vanillajs/05-token-renewal
and I'm getting this error in response:
{"error":"invalid_token","errorDescription":"Audience XXXXXXXXX is not valid."}
When I make the call to renewAuth, I pass the same audience value I used when calling new WebAuth (and it's not what I'm seeing in the error message (XXXX), which is an unintelligible sequence of characters).
After further examination, the Audience XXXXXX value that is being returned is my client id.
It turned out that I had the wrong client id after cutting and pasting the code from the quick start link. After fixing the client id, all is now well.

HTTP - Status Code

I'm using Spring Boot and controllers I'm feeling difficulty to treat some errors, for this reason I have some questions about the most appropriate status for each of the following situation:
PUT Object no Id
Put the URL localhost:8080/users/1 with a JSON without the Id attribute.
PUT Object with different parameter Id
Put the URL localhost:8080/users/1 with a JSON with Id 2, ie, different from what was passed in the parameter.
GET with invalid parameter
GET on the URL localhost:8080/users/search?sex=ABC, or an invalid sex for the system (the correct would be sex = male or female?).
JSON POST with id
Performing a POST in order to persist the data (create) but with id.
Case 1. Id is in the uri : no error
Case 3. "400 Bad request" is acceptable. (client should not retry the exact same request)
Cases 2. and 4. Just ignore the Id from the body and return 200 or return a "400 Bad Request"
Note that the id shouldn't be seen as an attribute of the resource: it is a part of the resource identifier.

How to specify error codes in Apiary Documentation?

I want to specify the various exceptions/errors that have to be returned while making an API call. How do I achieve this with Apiary.
Kyle's response is indeed correct. I will just add that if you want to add little bit more semantics to this you can write the other possible responses like this:
## POST /users/resendVerification/{userId}
Resends the user's verification code to the email address on record.
+ Response 201
+ Response 403
Returned if the user does not have access to the requested account
+ Body
+ Response 404
Returned if a user was not found for the given userId
+ Body
Note: The + Body is needed (even though it is empty) to distinguish the description from a message-body.
I'm not aware of a specific syntax for error codes. In the past I've simply used bullet points. For example, this is my code for a re-request verification code API.
## POST /users/resendVerification/{userId}
Resends the user's verification code to the email address on record.</br>
• 403 is returned if the user does not have access to the requested account</br>
• 404 is returned if a user was not found for the given userId</br>
+ Response 201
Hope that helps.

(Bash) $user#aol.com email availability checker

So, I'm trying to set up a script in bash to send a request to aim.com's signup form, where it allows you to check if an ID is able to be made like so:
https://new.aol.com/productsweb/?promocode=827692&ncid=txtlnkuswebr00000073
- Choose a username
if $user = available then $continue; else show "Sorry, that username isn't available.".
Once that concept is down, I'll have it running through a list of a good 100 or so to see if any of these are able to be re-made.
If anyone can just point me in a starting direction, that would be awesome!
Thank you for your time.
Looking at the referenced page, when you click the Check button, it sends a POST request to the following URL:
https://new.aol.com/productsweb/subflows/ScreenNameFlow/AjaxSNAction.do
With the following (required) parameter: s. This parameter needs to be set to the username you're testing for.
If the username exists, a "reloadEverything" message appears. If the username doesn't exist, a "toggleSNField" message appears.
If you want a real "Sorry, that username isn't available." message instead of the "reloadEverything", add two more parameters: l and f - and they both need to also be the username you're testing.
To accomplish this, you could iterate through your list of usernames and make a POST request with each and then just parse the response matching the above strings (the reloadEverything string is longer than that - so you could just do a substring match).

Resources