POST frame

Used to create a frame. This will be called with an array of frames to add, the arrays must include all required fields.

When accessed via a POST request this API method will create a new frame. Your HTTP body should consist of JSON similar to the following sample. Attributes differ per environment type so use the GET /api/environment method to determine the required and optional parameters.

Each attribute type/value will be validated to ensure that the data is valid. See the section on errors for how errors are represented.

INPUT

As this method is accessed via a POST request the raw body must be set to JSON as described below. Note that this is sample input for the Roadside environment type and as such the attributes sufficiently cover the required values.

[{
    "LocationDescription": "Some place",
    "SalesCode": "19A",
    "OnRoute": 1,
    "Format": {
        "SpaceFormatID": 1,
        "Width": 0.56,
        "Height": 0.24,
        "SurfaceArea": 0.13
    },
    "FrameType": 1,
    "Faces": 1,
    "Illumination": 1,
    "LegacySiteNumber": "SITE123456",
    "Localities": [1, 3],
    "Tags": [5, 8],
    "Environment": {
        "Type": "roadside",
        "Attributes": [{
                "Type": "Address",
                "Value": "address value"
            },
            {
                "Type": "PostCode",
                "Value": "SM12EA"
            },
            {
                "Type": "WorldGeodeticCoordinate",
                "Value": "49.76680500,-7.49999999"
            }
        ]
    }
}]
        

The table below details the fields used in this example.

parameter type description
FrameID integer (optional) When creating a frame with an existing FrameID the ID needs to be between 1000000000 and 1999999999
LocationDescription string (optional) location details to be associated with this frame. Must be less than 255 characters
SalesCode string (optional) sales code to be associated with this frame. Must be a three digit alphanumeric code
OnRoute int (required) whether the frame is on route or not on route specified by 1 or 0 respectively
Format Array (required) an array of format data
Format - SpaceFormatID int (required) SPACE format code to associate with this frame
Format - Width float (required) width for this format accurate to two decimal places between 0.01 and 1000 meters
Format - Height float (required) height for this format accurate to two decimal places between 0.01 and 500 meters
Format - SurfaceArea float (required) surface area for this format accurate to two decimal places between 0.01 and 500000 square meters
FrameType int (required) the type of frame (see GET /api/frame-type for values)
Faces int (required) number of faces that the frame has between 1 and 99
Tags array (optional) an array of tag_id's to associate with this frame (see GET /api/tag for values)
Localities array (optional) an array of locality_id's to associate with this frame (see GET /api/locality for values)
Illumination int (required) the type of illumination for the frame (see GET /api/illumination for values)
LegacySiteNumber string (optional) the legacy site number for the frame
Environment array (required) an array of Environment data
Environment - Type string (required) the type of environment for that frame (see GET /api/environment for values)
Environment - Attributes array (required) an array of Environment attributes (see GET /api/environment for values)
Environment - Attributes - Type string (required) the attribute type (see GET /api/environment for values)
Environment - Attributes - Value string (required) the attribute value (see GET /api/environment for values)

OUTPUT - JSON sample

If accessing POST /api/frame with the body set to the sample JSON above then the following JSON would be returned:

{
    "data": [{
        "FrameID": 2000000051,
        "LocationDescription": "Some place2",
        "SalesCode": "19C",
        "OnRoute": 1,
        "Format": {
            "SpaceFormatID": 1,
            "Width": 0.56,
            "Height": 0.24,
            "SurfaceArea": 0.13
        },
        "FrameType": 1,
        "Faces": 1,
        "Illumination": 1,
        "Environment": {
            "Type": "Roadside",
            "Attributes": [{
                    "Type": "WorldGeodeticCoordinate",
                    "Value": "49.76680500,-7.49999999"
                },
                {
                    "Type": "PostCode",
                    "Value": "SM12EA"
                },
                {
                    "Type": "Address",
                    "Value": "address value"
                }
            ]
        },
        "UpdateDateTime": "2015-02-25 14:00:34",
        "ClosedDate": null,
        "MediaOwner": "MediaTel",
        "MediaOwnerFrameReference": "BSY03B",
        "LegacySiteNumber": "SITE123456",
        "Tags": [
            5,
            8
        ],
        "Localities": [
            1,
            3
        ]
    }],
    "paging": {
        "page": 723,
        "page_size": 100,
        "total_pages": 723,
        "total_records": 72204
    }
}
        

A "data" element that contains an array of frames as defined within the response for GET /api/frame