This endpoint has two versions. All requests receive v2 unless they explicitly request v1, and the examples on this page use v2.
Requests that use the v=3 header from the API basics also receive v2 of this endpoint.
Using a script with this endpoint? v2 ignores the content and state parameters. If your script doesn't request v1, a POST with content creates an entry with no content and still returns HTTP status 201, and a PUT with content returns HTTP status 200 without changing the entry. Update your script to use shared_content, or request v1.
| v2 (default) | v1 (deprecated) | |
|---|---|---|
| Entry content | shared_content |
content, which contains the entry's Shared Content |
| Translations | Included in each entry, with their own endpoints | Not available |
| Locales | Read an entry in a Locale and list Locales | Not available |
| State | On each Translation | Not available |
| New entries | Start with an empty Translation in the default Locale | Start with no Translations, so they can't be added to a project until one is published |
To request v1, send this header:
Accept: application/vnd.dradisapi; v=1
GET /pro/api/addons/issuelib/entriesRetrieves all of the IssueLibrary entries from your instance.
Sample request:
curl \
-H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \
http://dradis-pro.dev/pro/api/addons/issuelib/entries
Result:
[
{
"id": 1,
"title": ".NET assemblies were not obfuscated",
"fields": {
"Title": ".NET assemblies were not obfuscated",
"Description": "The client-side assemblies were found to be strongly-named (which can help against tampering)...",
"id": "1"
},
"shared_content": "#[Title]#\r\n.NET assemblies were not obfuscated\r\n\r\n\r\n#[Description]#\r\nThe client-side assemblies were found to be strongly-named (which can help against tampering)...",
"created_at": "2019-03-14T20:35:45.000Z",
"updated_at": "2019-03-14T20:59:09.000Z",
"translations": [
{
"id": 11,
"state": "draft",
"locale": {
"id": 1,
"code": "en-US",
"name": "English (United States)"
},
"url": "http://dradis-pro.dev/pro/api/addons/issuelib/entries/1/translations/11"
}
]
},
{
"id": 2,
"title": "SQL injection",
"fields": {
"Title": "SQL injection",
"Description": "Structured Query Language (SQL) is a computer language designed for the retrieval and management of data in relation databases...",
"id": "2"
},
"shared_content": "#[Title]#\r\nSQL injection\r\n\r\n\r\n#[Description]#\r\nStructured Query Language (SQL) is a computer language designed for the retrieval and management of data in relation databases...",
"created_at": "2019-03-14T20:59:29.000Z",
"updated_at": "2019-03-14T20:59:29.000Z",
"translations": [
{
"id": 12,
"state": "draft",
"locale": {
"id": 1,
"code": "en-US",
"name": "English (United States)"
},
"url": "http://dradis-pro.dev/pro/api/addons/issuelib/entries/2/translations/12"
}
]
}
]
GET /pro/api/addons/issuelib/entries/:issuelibrary_entry_idRetrieves a single IssueLibrary entry.
Sample request:
curl \
-H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \
http://dradis-pro.dev/pro/api/addons/issuelib/entries/2
Result:
{
"id": 2,
"title": "SQL injection",
"fields": {
"Title": "SQL injection",
"Description": "Structured Query Language (SQL) is a computer language designed for the retrieval and management of data in relation databases...",
"id": "2"
},
"shared_content": "#[Title]#\r\nSQL injection\r\n\r\n\r\n#[Description]#\r\nStructured Query Language (SQL) is a computer language designed for the retrieval and management of data in relation databases...",
"created_at": "2019-03-14T20:59:29.000Z",
"updated_at": "2019-03-14T20:59:29.000Z",
"translations": [
{
"id": 12,
"state": "draft",
"locale": {
"id": 1,
"code": "en-US",
"name": "English (United States)"
},
"url": "http://dradis-pro.dev/pro/api/addons/issuelib/entries/2/translations/12"
}
]
}
GET /pro/api/addons/issuelib/entries/:issuelibrary_entry_id\?locale\=:codeRetrieves a single IssueLibrary entry as it reads in a specific Locale. The title and fields combine the Shared Content with the Translation in that Locale, and the response also includes the locale. If the entry has no content in that Locale, they contain the Shared Content.
A Locale code that doesn't exist returns HTTP status 422.
Sample request:
curl \
-H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \
http://dradis-pro.dev/pro/api/addons/issuelib/entries/4\?locale\=de
Result:
{
"id": 4,
"title": "Schwache Passwortrichtlinie",
"fields": {
"Title": "Schwache Passwortrichtlinie",
"Rating": "High",
"Description": "Benutzer können kurze Passwörter wählen, die leicht zu erraten sind.",
"id": "4"
},
"shared_content": "#[Title]#\r\nWeak password policy\r\n\r\n#[Rating]#\r\nHigh\r\n\r\n#[Description]#\r\nUsers can choose short passwords that are easy to guess.",
"created_at": "2019-03-14T20:59:29.000Z",
"updated_at": "2019-03-14T21:02:11.000Z",
"locale": {
"id": 2,
"code": "de",
"name": "German"
},
"translations": [
{
"id": 14,
"state": "draft",
"locale": {
"id": 1,
"code": "en-US",
"name": "English (United States)"
},
"url": "http://dradis-pro.dev/pro/api/addons/issuelib/entries/4/translations/14"
},
{
"id": 15,
"state": "published",
"locale": {
"id": 2,
"code": "de",
"name": "German"
},
"url": "http://dradis-pro.dev/pro/api/addons/issuelib/entries/4/translations/15"
}
]
}
GET /pro/api/addons/issuelib/entries\?q\=searchSearches for IssueLibrary entries containing the search term(s) specified, in their Shared Content or in any of their Translations.
Sample request:
curl \ -H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \ -H 'Dradis-Project-Id: 3' \ http://dradis-pro.dev/pro/api/addons/issuelib/entries\?q\=SQL+injection
Result:
[
{
"id": 2,
"title": "SQL injection",
"fields": {
"Title": "SQL injection",
"Description": "Structured Query Language (SQL) is a computer language designed for the retrieval and management of data in relation databases...",
"id": "2"
},
"shared_content": "#[Title]#\r\nSQL injection\r\n\r\n\r\n#[Description]#\r\nStructured Query Language (SQL) is a computer language designed for the retrieval and management of data in relation databases...",
"created_at": "2019-03-14T20:59:29.000Z",
"updated_at": "2019-03-14T20:59:29.000Z",
"translations": [
{
"id": 12,
"state": "draft",
"locale": {
"id": 1,
"code": "en-US",
"name": "English (United States)"
},
"url": "http://dradis-pro.dev/pro/api/addons/issuelib/entries/2/translations/12"
}
]
}
]
POST /pro/api/addons/issuelib/entriesCreates an IssueLibrary entry. The attributes for the IssueLibrary entry must be provided in the POST body as JSON.
The new entry also gets an empty Translation in the default Locale. It starts as draft, or as ready_for_review if the user doesn't have permission to update the IssueLibrary. Use the Translations endpoints to change its state.
HTTP status 201 will be returned if the creation completes successfully, and a Location header will be sent with the response, set to the URL of the newly created resource.
| Accepted Parameter | Use |
|---|---|
entry |
Pass it the shared_content parameter. |
shared_content |
Pass it the Shared Content of the IssueLibrary entry to be created. |
Sample request:
curl \
-H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \
-H 'Content-type: application/json' \
-X POST \
-d '{"entry":{"shared_content": "#[Title]#\r\nDangerous HTTP methods: TRACE\r\n\r\n#[Rating]#\r\nMedium\r\n\r\n#[Description]#\r\nThe TRACE HTTP method is used as a debugging mechanism that allows the client to see what is being received at the other end of the request chain and use that data for testing and diagnostic information."}}' \
http://dradis-pro.dev/pro/api/addons/issuelib/entries
Result:
{
"id": 3,
"title": "Dangerous HTTP methods: TRACE",
"fields": {
"Title": "Dangerous HTTP methods: TRACE",
"Rating": "Medium",
"Description": "The TRACE HTTP method is used as a debugging mechanism that allows the client to see what is being received at the other end of the request chain and use that data for testing and diagnostic information.",
"id": "3"
},
"shared_content": "#[Title]#\r\nDangerous HTTP methods: TRACE\r\n\r\n#[Rating]#\r\nMedium\r\n\r\n#[Description]#\r\nThe TRACE HTTP method is used as a debugging mechanism that allows the client to see what is being received at the other end of the request chain and use that data for testing and diagnostic information.",
"created_at": "2019-03-14T21:10:53.000Z",
"updated_at": "2019-03-14T21:10:53.000Z",
"translations": [
{
"id": 13,
"state": "draft",
"locale": {
"id": 1,
"code": "en-US",
"name": "English (United States)"
},
"url": "http://dradis-pro.dev/pro/api/addons/issuelib/entries/3/translations/13"
}
]
}
PUT /pro/api/addons/issuelib/entries/:issuelibrary_entry_idUpdates a specific IssueLibrary entry. The attributes to be updated must be provided in the body as JSON. Like the POST method, make sure to write out the new content of the IssueLibrary entry using JSON on one line subbing in \r\n to create new lines and creating fields using the #[ ]# syntax. If your content contains any special characters, be sure to escape them using /.
HTTP status 200 will be returned if the update completes successfully.
See POST above for more details on the accepted parameters.
Sample request:
curl \
-H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \
-H 'Content-type: application/json' \
-X PUT \
-d '{"entry":{"shared_content": "#[Title]#\r\nDangerous HTTP methods: TRACE\r\n\r\n#[Rating]#\r\nMedium\r\n\r\n#[Description]#\r\nUpdated sample IssueLibrary entry description"}}' \
http://dradis-pro.dev/pro/api/addons/issuelib/entries/3
Result:
{
"id": 3,
"title": "Dangerous HTTP methods: TRACE",
"fields": {
"Title": "Dangerous HTTP methods: TRACE",
"Rating": "Medium",
"Description": "Updated sample IssueLibrary entry description",
"id": "3"
},
"shared_content": "#[Title]#\r\nDangerous HTTP methods: TRACE\r\n\r\n#[Rating]#\r\nMedium\r\n\r\n#[Description]#\r\nUpdated sample IssueLibrary entry description",
"created_at": "2019-03-14T21:10:53.000Z",
"updated_at": "2019-03-14T21:14:33.000Z",
"translations": [
{
"id": 13,
"state": "draft",
"locale": {
"id": 1,
"code": "en-US",
"name": "English (United States)"
},
"url": "http://dradis-pro.dev/pro/api/addons/issuelib/entries/3/translations/13"
}
]
}
DELETE /pro/api/addons/issuelib/entries/:issuelibrary_entry_idDeletes a specific IssueLibrary entry from your instance. HTTP status 200 will be returned if the deletion completes successfully.
Sample request:
curl \
-H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \
-X DELETE \
http://dradis-pro.dev/pro/api/addons/issuelib/entries/3
Result:
{
"message": "Resource deleted successfully"
}
These endpoints work with the Translations of an entry. They are only available in v2. The fields of a Translation combine the entry's Shared Content with the Translation's own content.
GET /pro/api/addons/issuelib/entries/:issuelibrary_entry_id/translationsRetrieves all of the Translations of an IssueLibrary entry.
Sample request:
curl \
-H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \
http://dradis-pro.dev/pro/api/addons/issuelib/entries/4/translations
Result:
[
{
"id": 15,
"content": "#[Title]#\r\nSchwache Passwortrichtlinie\r\n\r\n#[Description]#\r\nBenutzer können kurze Passwörter wählen, die leicht zu erraten sind.",
"fields": {
"Title": "Schwache Passwortrichtlinie",
"Rating": "High",
"Description": "Benutzer können kurze Passwörter wählen, die leicht zu erraten sind.",
"id": "4"
},
"state": "published",
"entry": {
"id": 4,
"title": "Weak password policy",
"url": "http://dradis-pro.dev/pro/api/addons/issuelib/entries/4"
},
"locale": {
"id": 2,
"code": "de",
"name": "German"
},
"created_at": "2019-03-14T21:02:11.000Z",
"updated_at": "2019-03-14T21:05:40.000Z"
}
]
GET /pro/api/addons/issuelib/entries/:issuelibrary_entry_id/translations/:idRetrieves a single Translation.
Sample request:
curl \
-H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \
http://dradis-pro.dev/pro/api/addons/issuelib/entries/4/translations/15
Result:
{
"id": 15,
"content": "#[Title]#\r\nSchwache Passwortrichtlinie\r\n\r\n#[Description]#\r\nBenutzer können kurze Passwörter wählen, die leicht zu erraten sind.",
"fields": {
"Title": "Schwache Passwortrichtlinie",
"Rating": "High",
"Description": "Benutzer können kurze Passwörter wählen, die leicht zu erraten sind.",
"id": "4"
},
"state": "published",
"entry": {
"id": 4,
"title": "Weak password policy",
"url": "http://dradis-pro.dev/pro/api/addons/issuelib/entries/4"
},
"locale": {
"id": 2,
"code": "de",
"name": "German"
},
"created_at": "2019-03-14T21:02:11.000Z",
"updated_at": "2019-03-14T21:05:40.000Z"
}
POST /pro/api/addons/issuelib/entries/:issuelibrary_entry_id/translationsCreates a Translation for an IssueLibrary entry. The attributes must be provided in the POST body as JSON. HTTP status 201 will be returned if the creation completes successfully.
| Accepted Parameter | Use |
|---|---|
translation |
Pass it the locale_id, content, and state parameters. |
locale_id |
Pass it the ID of the Locale. An entry can only have one Translation per Locale. |
content (optional) |
Pass it the fields this Translation overrides. |
state (optional) |
Pass it draft (the default), ready_for_review, or published. Any other value returns HTTP status 422. |
Sample request:
curl \
-H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \
-H 'Content-type: application/json' \
-X POST \
-d '{"translation":{"locale_id": 2, "content": "#[Title]#\r\nSchwache Passwortrichtlinie\r\n\r\n#[Description]#\r\nBenutzer können kurze Passwörter wählen, die leicht zu erraten sind.", "state": "draft"}}' \
http://dradis-pro.dev/pro/api/addons/issuelib/entries/4/translations
Result:
{
"id": 15,
"content": "#[Title]#\r\nSchwache Passwortrichtlinie\r\n\r\n#[Description]#\r\nBenutzer können kurze Passwörter wählen, die leicht zu erraten sind.",
"fields": {
"Title": "Schwache Passwortrichtlinie",
"Rating": "High",
"Description": "Benutzer können kurze Passwörter wählen, die leicht zu erraten sind.",
"id": "4"
},
"state": "draft",
"entry": {
"id": 4,
"title": "Weak password policy",
"url": "http://dradis-pro.dev/pro/api/addons/issuelib/entries/4"
},
"locale": {
"id": 2,
"code": "de",
"name": "German"
},
"created_at": "2019-03-14T21:02:11.000Z",
"updated_at": "2019-03-14T21:02:11.000Z"
}
PUT /pro/api/addons/issuelib/entries/:issuelibrary_entry_id/translations/:idUpdates a Translation, for example to publish it. The attributes to be updated must be provided in the body as JSON. HTTP status 200 will be returned if the update completes successfully.
See POST above for more details on the accepted parameters.
Sample request:
curl \
-H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \
-H 'Content-type: application/json' \
-X PUT \
-d '{"translation":{"state": "published"}}' \
http://dradis-pro.dev/pro/api/addons/issuelib/entries/4/translations/15
Result:
{
"id": 15,
"content": "#[Title]#\r\nSchwache Passwortrichtlinie\r\n\r\n#[Description]#\r\nBenutzer können kurze Passwörter wählen, die leicht zu erraten sind.",
"fields": {
"Title": "Schwache Passwortrichtlinie",
"Rating": "High",
"Description": "Benutzer können kurze Passwörter wählen, die leicht zu erraten sind.",
"id": "4"
},
"state": "published",
"entry": {
"id": 4,
"title": "Weak password policy",
"url": "http://dradis-pro.dev/pro/api/addons/issuelib/entries/4"
},
"locale": {
"id": 2,
"code": "de",
"name": "German"
},
"created_at": "2019-03-14T21:02:11.000Z",
"updated_at": "2019-03-14T21:05:40.000Z"
}
DELETE /pro/api/addons/issuelib/entries/:issuelibrary_entry_id/translations/:idDeletes a Translation. HTTP status 200 will be returned if the deletion completes successfully.
Sample request:
curl \
-H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \
-X DELETE \
http://dradis-pro.dev/pro/api/addons/issuelib/entries/4/translations/15
Result:
{
"message": "Resource deleted successfully"
}
GET /pro/api/addons/issuelib/localesRetrieves all of the Locales on your instance, ordered by name. This endpoint is only available in v2. Locales can only be managed in the Dradis interface.
Sample request:
curl \
-H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \
http://dradis-pro.dev/pro/api/addons/issuelib/locales
Result:
[
{
"id": 1,
"code": "en-US",
"name": "English (United States)"
},
{
"id": 2,
"code": "de",
"name": "German"
}
]
Scoped Personal Access Tokens use the IssueLibrary scope for the Translations and Locales endpoints.
Great job, you reached the end of the guide! Have you read all of them?
Loading form...
Your email is kept private. We don't do the spam thing.