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

[Bug]: REST Api doc curl examples url not always within quotes #10

Open
8ctopus opened this issue Sep 26, 2023 · 2 comments
Open

[Bug]: REST Api doc curl examples url not always within quotes #10

8ctopus opened this issue Sep 26, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@8ctopus
Copy link

8ctopus commented Sep 26, 2023

Contact Details

[email protected]

Describe the Issue

Some of the curl examples have the destination url not within double quotes which can cause problems. Here's an example:

https://developer.paypal.com/docs/api/subscriptions/v1/#plans_list
$ curl -v -X GET https://api-m.sandbox.paypal.com/v1/billing/plans?sort_by=create_time&sort_order=desc \
-H 'Authorization: Bearer TOKEN_RETRACTED' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Prefer: return=representation'
[2] 2345
bash: -H: command not found
Note: Unnecessary use of -X or --request, GET is already inferred.
* processing: https://api-m.sandbox.paypal.com/v1/billing/plans?sort_by=create_time
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

Problem is fixed by enclosing the url within double quotes

$ curl -v -X GET "https://api-m.sandbox.paypal.com/v1/billing/plans?sort_by=create_time&sort_order=desc" \
-H 'Authorization: Bearer TOKEN_RETRACTED' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Prefer: return=representation'
Note: Unnecessary use of -X or --request, GET is already inferred.
* processing: https://api-m.sandbox.paypal.com/v1/billing/plans?sort_by=create_time&sort_order=desc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 199.232.169.35:443...
* Connected to api-m.sandbox.paypal.com (199.232.169.35) port 443
* schannel: disabled automatic use of client certificate
* using HTTP/1.x
> GET /v1/billing/plans?sort_by=create_time&sort_order=desc HTTP/1.1
> Host: api-m.sandbox.paypal.com
> User-Agent: curl/8.2.1
> Authorization: Bearer TOKEN_RETRACTED
> Content-Type: application/json
> Accept: application/json
> Prefer: return=representation
>
< HTTP/1.1 401 Unauthorized
< Connection: keep-alive
< Content-Length: 95
< Content-Type: application/json
< Server: nginx
< Cache-Control: max-age=0, no-cache, no-store, must-revalidate
< Paypal-Debug-Id: 13cb9c4b4755f
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Accept-Ranges: bytes
< Via: 1.1 varnish, 1.1 varnish
< Edge-Control: max-age=0
< Date: Tue, 26 Sep 2023 04:25:16 GMT
< X-Served-By: cache-lhr7338-LHR, cache-par-lfpg1960022-PAR
< X-Cache: MISS, MISS
< X-Cache-Hits: 0, 0
< X-Timer: S1695702316.041763,VS0,VE202
< Vary: Accept-Encoding
<
{ [95 bytes data]
100    95  100    95    0     0     90      0  0:00:01  0:00:01 --:--:--    90{"error":"invalid_token","error_description":"The token passed in was not found in the system"}
* Connection #0 to host api-m.sandbox.paypal.com left intact

Steps To Reproduce

See above

What type of Operating System are you seeing the problem on?

Windows

What type of browser are you seeing the problem on?

No response

Screenshots or Videos

No response

Code to produce this issue.

See above
@8ctopus 8ctopus added the bug Something isn't working label Sep 26, 2023
@devchristina devchristina self-assigned this Sep 26, 2023
@devchristina
Copy link
Contributor

Created an internal bug for our product & engineering team.

@8ctopus
Copy link
Author

8ctopus commented Sep 27, 2023

Thank you for looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants