PolesApi Resource

GET /poles

For an authenticated user, this method retrieves the list of pole which the user can edit

 https://ethersource.gavagai.se/ethersource/rest/v2/poles
 

Response Body
media type data type description
application/json;charset="UTF-8" (custom) The poles which the user can edit

Example

Request
GET /poles
Content-Type: */*
Accept: application/json;charset="UTF-8"

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset="UTF-8"

                
...
                
              

POST /poles

For an authenticated user, this method allows the user to create a pole

 https://ethersource.gavagai.se/ethersource/rest/v2/poles
 

Request Body
media type data type description
application/json Pole (JSON) The pole to be created in json structure { "name":"POS EN", "description":"Positive ENGLISH", "language":"EN", "parts":[ { "term":"(*^^*)", "weight":1.0 } ]}
Response Body
media type data type description
application/json;charset="UTF-8" (custom) The created pole, with the id

Example

Request
POST /poles
Content-Type: application/json
Accept: application/json;charset="UTF-8"

                
{
  "parts" : [ {
    "term" : "...",
    "weight" : 12345.0
  }, {
    "term" : "...",
    "weight" : 12345.0
  } ],
  "language" : "AY",
  "description" : "...",
  "name" : "..."
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json;charset="UTF-8"

                
...
                
              

DELETE /poles/{id}

For an authenticated user, this method deletes a pole, if he has sufficient rights

 https://ethersource.gavagai.se/ethersource/rest/v2/poles/1/
 

Request Parameters
name type description constraints
id path The poleId which is to be deleted min: 1
Response Body
media type data type description
application/json;charset="UTF-8" (custom) The deleted pole

Example

Request
DELETE /poles/{id}
Content-Type: */*
Accept: application/json;charset="UTF-8"

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json;charset="UTF-8"

                
...
                
              

GET /poles/{id}

For an authenticated user, this method retrieves the details of a pole specified by an id, if the user has access to it.

 https://ethersource.gavagai.se/ethersource/rest/v2/poles/1
 

Request Parameters
name type description constraints
id path The id of the pole to retrieve min: 1
Response Body
media type data type description
application/json;charset="UTF-8" (custom) The requested pole

Example

Request
GET /poles/{id}
Content-Type: */*
Accept: application/json;charset="UTF-8"

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset="UTF-8"

                
...
                
              

PUT /poles/{id}

For an authenticated user, this method allows the user to update a pole, if he has access to it

 https://ethersource.gavagai.se/ethersource/rest/v2/poles
 

Request Parameters
name type description default constraints
id path The id of the pole to be updated   min: 1
clearContents query If this flag is set, the pole parts are cleared and are populated with the pole parts in the json payload. If it is not set, the pole parts in the payload are appended to the existing pole parts true boolean
Request Body
media type data type description
application/json Pole (JSON) The pole, in json structure { "name":"POS EN", "description":"Positive ENGLISH", "language":"EN", "parts":[ { "term":"(*^^*)", "weight":1.0 } ]}
Response Body
media type data type description
application/json;charset="UTF-8" (custom) The updated pole, with the id

Example

Request
PUT /poles/{id}
Content-Type: application/json
Accept: application/json;charset="UTF-8"

                
{
  "parts" : [ {
    "term" : "...",
    "weight" : 12345.0
  }, {
    "term" : "...",
    "weight" : 12345.0
  } ],
  "language" : "VO",
  "description" : "...",
  "name" : "..."
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json;charset="UTF-8"

                
...
                
              

GET /poles/{id}/suggest

For an authenticated user, this method retrieves suggestions for a pole, if he has access to it

 https://ethersource.gavagai.se/ethersource/rest/v2/poles/1/suggest
 

Request Parameters
name type description constraints
id path The poleId for which suggestions are required min: 1
Response Body
media type data type description
application/json;charset="UTF-8" (custom) The suggestions with the pole itself

Example

Request
GET /poles/{id}/suggest
Content-Type: */*
Accept: application/json;charset="UTF-8"

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset="UTF-8"

                
...