API Documentation

API Endpoint

Sections

Sections

GET /api/v2/sections
Requestsreturns sections

GET  /api/v2/sections

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "45",
      "type": "sections",
      "attributes": {
        "name": "section name",
        "preferences": {
          "width": "90%"
        },
        "position": 1,
        "editor_config": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": "1835"
          }
        },
        "deal": {
          "meta": {
            "included": false
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://api-test.productive.io/api/v2/sections?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://api-test.productive.io/api/v2/sections?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get sections
GET/api/v2/sections


GET /api/v2/sections/1
Requestsreturns section

GET  /api/v2/sections/46

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "46",
    "type": "sections",
    "attributes": {
      "name": "section name",
      "preferences": {
        "width": "90%"
      },
      "position": 1,
      "editor_config": {}
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "1836"
        }
      },
      "deal": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Gets a section
GET/api/v2/sections/{id}

URI Parameters
HideShow
id
number (required) Example: 1

section id


POST /api/v2/sections
Requestscreates sectionreturns error

POST  /api/v2/sections

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "sections",
    "attributes": {
      "name": "test name"
    },
    "relationships": {
      "deal": {
        "data": {
          "type": "deals",
          "id": "1631"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "48",
    "type": "sections",
    "attributes": {
      "name": "test name",
      "preferences": null,
      "position": 1,
      "editor_config": null
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "1837"
        }
      },
      "deal": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

POST  /api/v2/sections

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "sections",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/deal"
      }
    }
  ]
}

Create a section
POST/api/v2/sections

URI Parameters
HideShow
name
string (required) Example: Name

name


PATCH /api/v2/sections/1
Requestsupdates sectionreturns error

PATCH  /api/v2/sections/50

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "sections",
    "attributes": {
      "name": "new name"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "50",
    "type": "sections",
    "attributes": {
      "name": "new name",
      "preferences": {
        "width": "90%"
      },
      "position": 1,
      "editor_config": {}
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "1839"
        }
      },
      "deal": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

PATCH  /api/v2/sections/51

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "sections",
    "attributes": {
      "deal_id": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/deal"
      }
    }
  ]
}

Update a section
PATCH/api/v2/sections/{id}

URI Parameters
HideShow
id
number (required) Example: 1

section id


DELETE /api/v2/sections/1
Requestsdeletes section

DELETE  /api/v2/sections/52

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a section
DELETE/api/v2/sections/{id}

URI Parameters
HideShow
id
number (required) Example: 1

section id


Generated by aglio on 18 Apr 2024