API - Requirement documents

List

Description: Provides a paginated list of all requirement documents within a given project.

Endpoint: <base_url>/v1/projects/{project_id}/requirement_documents.json

Request: GET

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • page - {Integer} of the page (Default: 1)
  • order - {Integer} of how to order the list (Default: 0)
    • Options:
      • 0 - Created at
      • 1 - Updated at
      • 2 - Title

Response

{
  "pagination": { .... },
  "requirement_documents": [
    { .... },
    { .... }
  ]
}

Example ruby request

HTTParty.get('https://example.api.testlodge.com/v1/projects/1/requirement_documents.json', query: { order: 2 })

Example Response

Response code: 200

{
  "pagination": {
    "total_entries":2,
    "total_pages":1,
    "current_page":1,
    "next_page":null,
    "previous_page":null,
    "per_page":20
  },
  "requirement_documents":[{
    "id":1,
    "title":"Functional requirements",
"should_version":false,
"project_id":1,
    "created_at":"2014-02-26T14:33:58Z",
    "updated_at":"2014-02-26T14:33:58Z"
  },
  { .... }]
}

 

Show

Description: Get the details for a requirement document.

Endpoint: <base_url>/v1/projects/{project_id}/requirement_documents/{id}.json

Request: GET

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • id - {Integer} The requirement document ID (Required)

Response

{ .... }

Example ruby request

HTTParty.get('https://example.api.testlodge.com/v1/projects/1/requirement_documents/1.json')

Example Response

Response code: 200

{
"id":1,
  "title":"Functional requirements",
"should_version":false,
"project_id":1,
  "created_at":"2014-02-26T14:33:58Z",
  "updated_at":"2014-02-26T14:33:58Z"
}

 

Create

Description: Create a new requirement document.

Endpoint: <base_url>/v1/projects/{project_id}/requirement_documents.json

Request: POST

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • requirement_document:
    • title - {String} The requirement document title (Required)
    • should_version - {Boolean} If the content of the requirement document should be versioned when changed (Default: false)

Response

{ .... }

Example ruby request

HTTParty.post('https://example.api.testlodge.com/v1/projects/1/requirement_documents.json', body: { 
requirement_document: {
  title: 'Example doc',
    should_version: true
  }
})

Example Response

Response code: 201

{
"id":1,
  "title":"Example doc",
"should_version":true,
"project_id":1,
  "created_at":"2014-02-26T14:33:58Z",
  "updated_at":"2014-02-26T14:33:58Z"
}

 

Update

Description: Update a new requirement document.

Endpoint: <base_url>/v1/projects/{project_id}/requirement_documents/{id}.json

Request: PATCH

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • id - {Integer} The requirement document ID (Required)
  • requirement_document:
    • title - {String} The requirement document title
    • should_version - {Boolean} If the content of the requirement document should be versioned when changed

Response

{ .... }

Example ruby request

HTTParty.patch('https://example.api.testlodge.com/v1/projects/1/requirement_documents/1.json', body: { 
requirement_document: {
  name: 'New name'
  }
})

Example Response

Response code: 200

{
"id":1,
  "title":"New name",
"should_version":true,
"project_id":1,
  "created_at":"2014-02-26T14:33:58Z",
  "updated_at":"2014-02-26T14:33:58Z"
}

 

Delete

Description: Delete a requirement document.

Endpoint: <base_url>/v1/projects/{project_id}/requirement_documents/{id}.json

Request: DELETE

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • id - {Integer} The requirement document ID (Required)

Response

{ }

Example ruby request

HTTParty.delete('https://example.api.testlodge.com/v1/projects/1/requirement_documents/1.json')

Example Response

Response code: 204

{ }
Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.