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 postman collection for backend API #3726

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

dnviti
Copy link

@dnviti dnviti commented Apr 27, 2024

No description provided.

@kmanwar89
Copy link

kmanwar89 commented May 13, 2024

Hey there,

I was able to import this collection into Postman (in a bit of a roundabout way) and tried to create a host, but it appears the payload sent in the body doesn't match what is sent when it's done via the GUI.

Body payload in the collection:

{
    "domain_names": [],
    "forward_scheme": "",
    "forward_host": "",
    "forward_port": "",
    "certificate_id": "",
    "ssl_forced": true,
    "hsts_enabled": true,
    "hsts_subdomains": true,
    "http2_support": true,
    "block_exploits": true,
    "caching_enabled": true,
    "allow_websocket_upgrade": true,
    "access_list_id": 0,
    "advanced_config": "",
    "enables": true,
    "meta": "",
    "locations": ""
}

Working payload taken from the request in the GUI (and reproduced in Postman); this was using a cert created from Cloudflare, rather than Let's Encrypt:

{
  "domain_names": [
    "subdomain.domain.com"
  ],
  "forward_scheme": "http/https",
  "forward_host": "",
  "forward_port": #,
  "access_list_id": "0",
  "certificate_id": #,
  "meta": {
    "letsencrypt_agree": false,
    "dns_challenge": false
  },
  "advanced_config": "",
  "locations": [],
  "block_exploits": false,
  "caching_enabled": false,
  "allow_websocket_upgrade": false,
  "http2_support": false,
  "hsts_enabled": false,
  "hsts_subdomains": false,
  "ssl_forced": false
}

Using the original payload returns a 400 "internal error" (which is not terribly useful in troubleshooting :) )

image

Doing some quick testing and trying to match the 1st to 2nd body, I think I discovered the error: "enables" should be "enabled". Even matching the body almost exactly would then return a "400 data should NOT have additional properties" error:

image

Changed the s to a and it worked!

image

Also need to mention that the domain_names field requires "" around the subdomain, otherwise the same Internal Server Error error is returned:

"domain_names": ["subdomain.domain.com"]

@jc21
Copy link
Member

jc21 commented Oct 11, 2024

On the develop branch, and in the next release, there's a full OpenAPI schema available on the /api/schema endpoint. That should be importable into Postman and others.

@nginxproxymanagerci
Copy link

CI Error:

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
certbot-node: Pulling from nginxproxymanager/nginx-full
Digest: sha256:eaa2ebcb50dd87557c9a8f95a3230128d94cac1ea17800261c036e59378e7d49
Status: Image is up to date for nginxproxymanager/nginx-full:certbot-node
docker.io/nginxproxymanager/nginx-full:certbot-node
�[1;34m❯ �[1;36mBuilding Frontend ...�[0m
yarn install v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: clone https:/tabler/tabler.git /usr/local/share/.cache/yarn/v6/.tmp/e11a93799a52aa978c82015e29fbe309
Directory: /app/frontend
Output:
Cloning into '/usr/local/share/.cache/yarn/v6/.tmp/e11a93799a52aa978c82015e29fbe309'...
error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 6401 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

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.

3 participants