6 To edit app details
matu6968 edited this page 2024-11-21 02:13:17 +01:00

To edit app details:

HTTP request type: PUT

Authorization required: Yes (Header: Bearer auth, key is located in .env file)

Endpoint: /editapp

Parameters required:

Multipart body:

1. metadata:
  {
		"appid": "094837638740",
		"app": {
			    "name": "tes",
                "ver": "2",
                "info": "thisisanewtestedit",
                "pub": "matu6968"
		}
  }
2. file (optional): specify a new file for updated version

Output:

If it is successful:

{
	"message": "App updated successfully"
}

Status code: 200

If there is no token specified in header:

{
	"error": "No authorization header"
}

Status code: 401

If there is a invalid token:

{
	"error": "Invalid token"
}

Status code: 401

If there is no metadata in multipart body specified:

{
	"error": "Metadata is required"
}

Status code: 400

If there metadata file in multipart body is invalid:

{
	"error": "Invalid metadata format"
}

Status code: 400

If there is a problem while saving apps.json onto the host, while making a directory to the uploaded file or while saving the uploaded file: (likely cause is directory where the binary is located is set to read only)

{
	"error": "Failed to save file"
}

Status code: 500

If there is a invalid multipart body:

{
	"error": "Invalid request body"
}

Status code: 400

If there is no or invalid app ID specified:

{
	"error": "App not found"
}

Status code: 404

If using a HTTP request other then PUT:

{
	"error": "Method not allowed. Only PUT is supported for this endpoint."
}

Status code: 405