Skip to content

Latest commit

 

History

History
58 lines (40 loc) · 1.08 KB

post.md

File metadata and controls

58 lines (40 loc) · 1.08 KB

Creates new device

Creates a new device

  • URL

    /api/devices

  • Method:

    POST

  • Data Params

       {
           device: {
               deviceId: string,
               name: string,
               type: string,
               measurementMethod: string,
               interruptionsAllowed: boolean,
               maxPower: number,
               emSignalsAccepted: boolean,
               status: string,
               vendor: string,
               serialNr: string,
               absoluteTimestamps: boolean,
               optionalEnergy: boolean,
               minOnTime?: number,
               minOffTime?: number,
               url?: string
           }
       }  
    
  • Success Response:

    • Code: 200
  • Error Response:

    • Code: 404 NOT FOUND

    OR

    • Code: 400 BAD REQUEST

    OR

    • Code 405 RESOURCE COULD NOT BE CREATED
  • Notes:

    Returns 405 if device with same ID already exists.

    The format of the Device ID is specified in the SEMP documentation provided by SMA, page 22.