Method

POST(HTTP)

Request Url

http://ai.measuresquare.com/api/file

Authentication

Use HTTP Basic auth
We will provide a string format of user:pass
BASE64 encode the string
Supply an Authorization header with content Basic followed by the encoded string.
For example:

The string 'user:pass' encodes to 'dXNlciUzQXBhc3M='
So that we should add "Authorization: Basic dXNlciUzQXBhc3M=" to request header

Parameters

Return:

data example

     {
        rooms:[
            {
                id: 1,
                points: [
                    { x:x1, y:y1}, { x:x2, y:y2}, ...
                ]
            },
            {
                id: 2,
                points: [
                    { x:x1, y:y1}, { x:x2, y:y2}, ...
                ]
            }
            ...
        ],
        doors:[
            {
                id: 1,
                points: [  { x:x1, y:y1}, { x:x2, y:y2} ]
            },
            {
                id: 2,
                points: [  { x:x1, y:y1}, { x:x2, y:y2} ]
            },
            ...
        ]
    }

Python example

data = {'PixelLength':4}
files = {'file': open(filepath, 'rb')}
response = requests.post(url, data=data, files=files, auth=HTTPBasicAuth('user', 'pass'))