Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Current »

Request

HTTP ELEMENT

Value

URI

/rest/crud/1.0/$tableKey/$id

METHOD

PUT

Content-Type

application/json

BODY

name - name of the Data - REQUIRED

spaceKey - space where Data will be attached - REQUIRED

column.keys - This is the field defined on CREATE Table

SAMPLE

{
    "name": "name3", 
	"spaceKey": "DEMO", 
	//json element name is base from column.key on database 
    "field-currency": 200, //currency must be a number 
    "field-number": "1", //number must be a number 
    "field-percent": "2", //percent must be a number
    "field-required": "required", //if field is required, should be required
    "field-checkbox": "false", // must be true/false 
    "field-ipaddress": "121212121", //must be a ipv4 ip-address
    "field-hyperlink": "https://google.com.ph?q=yes", // must be a http or https url 
    "field-type": {
    	"id": "56", // for field of type Type, id is mandatory/required
    	"name": "wtf"
    }
}

Response

HTTP ELEMENT

VALUE

BODY

Return JSON depends on the HTTP STATUS

HTTP STATUS CODEBODY200KeyDescriptionnamename of the Data the same as what you put on the requestspaceKeyspace where Data will be attached same as what you put on the requestcolumn.keysThis is the field define on CREATE TABLE same as what you put on the request400KeyDescriptionerrormain category of the errormessageerror message404

Scenario

Response

POSITIVE/Good Request

{
    "field-percent": "2",
    "field-required": "required",
    "field-currency": "200",
    "field-checkbox": "false",
    "name": "name3",
    "field-number": "1",
    "field-ipaddress": "121212121",
    "id": 61,
    "field-type": {
        "id": 56,
        "name": "name3"
    },
    "field-hyperlink": "https://google.com.ph?q=yes"
}

$name is not specify

{
	"spaceKey": "DEMO",
    "field-type": {
        "id": 56,
        "name": "name3"
    },
    "field-hyperlink": "https://google.com.ph?q=yes"
}

HTTP STATUS: 400

{
    "error": "REQUIRED",
    "message": "name is required"
}

$spaceKey is not specified

{
	"name": "Row 1st",
    "field-type": {
        "id": 56,
        "name": "name3"
    },
    "field-hyperlink": "https://google.com.ph?q=yes"
}

HTTP STATUS: 400

{
    "error": "REQUIRED",
    "message": "spaceKey is required"
}

$spaceKey is non-existing

HTTP STATUS: 400

{
    "error": "NON_EXISTING",
    "message": "Space[DEM] does not exists"
}

$tableKey is non-existing

HTTP STATUS: 404

 {
    "error": "NOT FOUND",
    "message": "URL doesn't point to existing table"
}

row is non-existing

HTTP STATUS: 404

 {
    "error": "NOT FOUND",
    "message": "Not Found"
}
  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.