Submit series data

Recipes for specific tasks against the API.

Edit a series, or add a new one, through the same submission API the website uses. Fetch the current record, change what you need, and send it back.

Before you start#↑

  • You need a personal access token, sent as x-api-key. OAuth tokens and Authorization: Bearer are not accepted here.
  • The API is open to the contributor role and up, or to anyone with at least 25 approved submissions. Below that it answers 403 with the message Submission API access requires contributor role or at least 25 approved submissions.
  • Contributors and up apply changes right away. Everyone else's changes wait for a moderator, and you can have at most min(2 × approved submissions, 250) waiting at once.
  • These endpoints are /v0: they work, but can still change. See versioning and stability.

The path names a resource. This guide uses series; the API reference lists the others.

1. Fetch the snapshot#↑

curl -H "x-api-key: mb-your-token" \
  "https://api.mangabaka.org/v0/my/submissions/series/1995"

You get the record in the shape a save takes, and a version. Trimmed:

{
	"status": 200,
	"data": {
		"version": 1807573570293,
		"data": {
			"media_type": null,
			"status": null,
			"total_chapters": null,
			"series_titles": [
				{
					"title": "Frieren: After \"The End\"",
					"language": "id",
					"is_primary": true
				}
			]
		}
	}
}

Most single-value fields are overrides. null means MangaBaka takes the value from its sources; set one to override them.

2. Preview the change#↑

Send only the fields you are changing. Preview shows what a save would do and writes nothing:

curl -X POST "https://api.mangabaka.org/v0/my/submissions/series/1995/preview" \
  -H "x-api-key: mb-your-token" \
  -H "Content-Type: application/json" \
  -d '{"data": {"status": "completed"}}'
{
	"status": 200,
	"data": {
		"has_changes": true,
		"changes": [
			{
				"field": "status",
				"type": "changed",
				"details": {
					"value": {
						"old": null,
						"new": "completed"
					}
				}
			}
		]
	}
}

3. Save it#↑

Drop /preview, and add the version from step 1 and a user_note saying why:

curl -X POST "https://api.mangabaka.org/v0/my/submissions/series/1995" \
  -H "x-api-key: mb-your-token" \
  -H "Content-Type: application/json" \
  -d '{
    "version": 1807573570293,
    "user_note": "Series finished publishing",
    "data": {"status": "completed"}
  }'

The response carries the same changes list, so you can confirm what was applied or queued. Contributors can add "save_mode": "review" to send a change to the moderator queue instead of applying it.

What you send#↑

  • Fields you leave out keep their current value.
  • Lists replace the whole list: images, tags, links and relationships. Take the full list from the snapshot, change it, and send all of it. Leave a list out to keep it as it is.
  • series_titles is different: titles you leave out stay. To remove one, send it with is_excluded: true. New titles have no id.
  • user_note is required on every save.

Conflicts#↑

version stops you overwriting someone else's edit. If the series changed after you fetched it, the save is refused and nothing is written:

{
	"status": 409,
	"message": "Submission conflicts with a concurrent change",
	"code": null
}

Fetch the snapshot again, apply your change to the new data, and save with the new version. Never reuse an old one.

Create a series#↑

Create takes the full record and no version:

curl -X POST "https://api.mangabaka.org/v0/my/submissions/series" \
  -H "x-api-key: mb-your-token" \
  -H "Content-Type: application/json" \
  -d '{"user_note": "New standalone series", "data": {}}'

Fill data with the fields from a snapshot. Contributors get the series created right away; other users' new series wait for a moderator.

Follow up on a submission#↑

Next#↑