Skip to content

Update Server Build Configuration: Wrong example request code shown for all coding languages #16

@semi-constructor

Description

@semi-constructor

📖 Documentation Improvement

📍 Location

Please specify which part of the documentation needs improvement:

💡 Suggested Improvement

A clear and concise description of what you'd like to see improved.

The endpoint and code is shown for the suspend endpoint.

🔍 Current Content

Quote or describe the current content that needs improvement.
Thats the current content, it also applies for all other coding languages.

const axios = require('axios');

const serverId = 2;
const response = await axios.post(`https://your-panel.com/api/application/servers/${serverId}/suspend`, {}, {
  headers: {
    'Authorization': 'Bearer ptla_YOUR_API_KEY',
    'Accept': 'Application/vnd.pterodactyl.v1+json'
  }
});

console.log('Server suspended successfully');

✨ Proposed Content

Describe or provide the improved content you'd like to see.
Here would be the correct JS version:

const axios = require("axios");

const serverId = 2;
const updatedConfiguration = {
    allocation: 3,
    memory: 2048,
    swap: 50,
    io: 10,
    cpu: 40,
    feature_limits: {
        databases: 2,
        backups: 1,
        allocations: 3
    }
}
const response = await axios.patch(`https://your-panel.com/api/application/servers/${serverId}/build`, updatedConfiguration, {
    headers: {
        'Authorization': `Bearer ptla_YOUR_API_KEY`,
        'Accept': 'Application/vnd.pterodactyl.v1+json',
        'Content-Type': 'application/json'
    }
})

🎁 Additional Value

Explain how this improvement would help other developers.

Its wrongly shown so ig :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions