Project Version Resource

Project version resource API, replacing ProjectIterationResource.

GET /project/{projectSlug}/version/{versionSlug}

Returns data for a single Project iteration.

Request Parameters
name type description constraints
projectSlug path Project identifier regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
versionSlug path Project version identifier regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
Response Body
media type data type description
application/json Project Version (JSON) The following response status codes will be returned from this operation:
OK(200) - Contains the Project version data.
NOT FOUND(404) - response, if a Project version could not be found for the given parameters.
INTERNAL SERVER ERROR(500) - If there is an unexpected error in the server while performing this operation.
application/vnd.zanata.project.iteration+json Project Version (JSON)
application/vnd.zanata.project.iteration+xml Project Version (XML)
application/xml Project Version (XML)

Example

Request
GET /project/{projectSlug}/version/{versionSlug}
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "id" : "my-iteration",
  "links" : [ { }, { } ],
  "status" : "OBSOLETE",
  "projectType" : "Podir"
}
                
              

HEAD /project/{projectSlug}/version/{versionSlug}

Returns header information for a project iteration.

Request Parameters
name type description constraints
projectSlug path Project identifier regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
versionSlug path Project version identifier regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
Response Body
media type data type description
application/json object (JSON) The following response status codes will be returned from this operation:
OK(200) - Response with an "Etag" header for the requested project iteration.
NOT FOUND(404) - If a project iteration could not be found for the given parameters.
INTERNAL SERVER ERROR(500) - If there is an unexpected error in the server while performing this operation.
application/vnd.zanata.project.iteration+json object (JSON)
application/vnd.zanata.project.iteration+xml anyType (XML)
application/xml anyType (XML)

Example

Request
HEAD /project/{projectSlug}/version/{versionSlug}
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

PUT /project/{projectSlug}/version/{versionSlug}

Creates or modifies a Project iteration.

Request Parameters
name type description constraints
projectSlug path regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
versionSlug path regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
Request Body
media type data type description
application/json Project Version (JSON) The project iteration information.
application/vnd.zanata.project.iteration+json Project Version (JSON)
application/vnd.zanata.project.iteration+xml Project Version (XML)
application/xml Project Version (XML)
Response Body
media type data type description
application/json object (JSON) The following response status codes will be returned from this operation:
OK(200) - If an already existing project iteration was updated as a result of this operation.
CREATED(201) - If a new project iteration was added.
NOT FOUND(404) - If no project was found for the given project slug.
FORBIDDEN(403) - If the user was not allowed to create/modify the project iteration. In this case an error message is contained in the response.
UNAUTHORIZED(401) - If the user does not have the proper permissions to perform this operation.
INTERNAL SERVER ERROR(500) - If there is an unexpected error in the server while performing this operation.
application/xml anyType (XML)

Example

Request
PUT /project/{projectSlug}/version/{versionSlug}
Content-Type: application/json
Accept: application/json

                
{
  "id" : "my-iteration",
  "links" : [ { }, { } ],
  "status" : "ACTIVE",
  "projectType" : "Podir"
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
...
                
              

GET /project/{projectSlug}/version/{versionSlug}/config

Get a project iteration's sample general configuration file(zanata.xml). Note: this will only be a sample configuration which does not contain any customization done on the client side, such as, locale mapping and/or command hooks.

Request Parameters
name type description constraints
projectSlug path Project identifier regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
versionSlug path Project version identifier regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
Response Body
media type data type description
application/xml anyType (XML) The following response status codes will be returned from this operation:
OK(200) - Contains the Project iteration config xml.
NOT FOUND(404) - response, if a Project iteration could not be found for the given parameters.
INTERNAL SERVER ERROR(500) - If there is an unexpected error in the server while performing this operation.

Example

Request
GET /project/{projectSlug}/version/{versionSlug}/config
Accept: application/xml

              
Response
HTTP/1.1 200 OK
Content-Type: application/xml

                
...
                
              

GET /project/{projectSlug}/version/{versionSlug}/docs

Retrieve the List of Documents (Resources) belongs to a Project version.

Request Parameters
name type description constraints
projectSlug path Project identifier regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
versionSlug path Project version identifier regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
Response Body
media type data type description
application/json array of ResourceMeta (JSON) The following response status codes will be returned from this operation:
OK(200) - Response with a list of documents wrapped in a "resources" element. Each child element will be a "resource-meta".
NOT FOUND(404) - If a Project iteration could not be found with the given parameters.
INTERNAL SERVER ERROR(500) - If there is an unexpected error in the server while performing this operation.

Example

Request
GET /project/{projectSlug}/version/{versionSlug}/docs
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
[ {
  "extensions" : [ { }, { } ],
  "type" : "PAGE",
  "lang" : "...",
  "contentType" : "...",
  "name" : "...",
  "revision" : 12345
} ]
                
              
See Also
GET Version Locales

GET /project/{projectSlug}/version/{versionSlug}/locales

Retrieves a full list of locales enabled in project version.

See Also
GET Version Locales
Request Parameters
name type description constraints
projectSlug path Project identifier regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
versionSlug path Project version identifier regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
Response Body
media type data type description
application/json array of Locale Details (JSON) The following response status codes will be returned from this operation:
OK(200) - Response containing a full list of locales.
NOT FOUND(404) - If a Version could not be found for the given parameters.
INTERNAL SERVER ERROR(500) - If there is an unexpected error in the server while performing this operation.
application/vnd.zanata.version.locales+json array of Locale Details (JSON)

Example

Request
GET /project/{projectSlug}/version/{versionSlug}/locales
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
[ {
  "localeId" : "es-ES",
  "displayName" : "Spanish (Spain)",
  "alias" : "es",
  "nativeName" : "EspaƱol",
  "enabled" : true,
  "enabledByDefault" : true,
  "pluralForms" : "nplurals=2; plural=(n != 1)",
  "rtl" : true
} ]
                
              

GET /project/{projectSlug}/version/{versionSlug}/contributors/{dateRange}

Get list of contributor (translator/review) for the given project version in date range.

Request Parameters
name type description constraints
dateRange path date range from..to (yyyy-mm-dd..yyyy-mm-dd)  
projectSlug path project identifier regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
versionSlug path version identifier regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
Response Body
media type data type
application/json array of User (JSON)
application/vnd.zanata.version+json array of User (JSON)

Example

Request
GET /project/{projectSlug}/version/{versionSlug}/contributors/{dateRange}
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
[ {
  "username" : "...",
  "email" : "...",
  "name" : "...",
  "imageUrl" : "...",
  "languageTeams" : [ "...", "..." ],
  "roles" : [ "...", "..." ]
} ]
                
              

POST /project/{projectSlug}/version/{versionSlug}/doc/{docId}/status/{localeId}

Queries for a list of translation unit id with status in a document.

Request Parameters
name type description default constraints
docId path The document identifier.    
localeId path target locale, default to 'en-US' en-US  
projectSlug path Project identifier   regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
versionSlug path Project version identifier   regex: [a-zA-Z0-9]+([a-zA-Z0-9_\-{.}]*[a-zA-Z0-9]+)?
Request Body
media type data type
application/json Filter Constraints (JSON)
Response Body
media type data type description
application/json array of TransUnitStatus (JSON) The following response status codes will be returned from this operation:
OK(200) - Response containing a full list of locales.
NOT FOUND(404) - If a document or locale could not be found for the given parameters.
INTERNAL SERVER ERROR(500) - If there is an unexpected error in the server while performing this operation.
application/vnd.zanata.tu.resource+json array of TransUnitStatus (JSON)

Example

Request
POST /project/{projectSlug}/version/{versionSlug}/doc/{docId}/status/{localeId}
Content-Type: application/json
Accept: application/json

                
{
  "searchString" : "best of times",
  "resId" : "521bbc0112de4af32209f11f07809614",
  "changedBefore" : "2016-12-16",
  "changedAfter" : "2004-03-02",
  "lastModifiedByUser" : "damason",
  "sourceComment" : "full name of the user",
  "transComment" : "translated literally",
  "msgContext" : "main.c"
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
[ {
  "id" : 12345,
  "resId" : "...",
  "status" : "Rejected"
} ]