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"]

@nginxproxymanagerci
Copy link

Docker Image for build 2 is available on DockerHub as jc21/nginx-proxy-manager:github-pr-3726

Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.

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.

None yet

2 participants