lwm2m.profile.create

The lwm2m.profile.create command is used to create a LWM2M profile.

TR50 Request

{
  "1": {
    "command": "lwm2m.profile.create",
    "params": {
      "global": true,
      "name": "Example profile",
      "desc": "An example LWM2M profile",
      "readOnRegister": [
        {
          "objId": 3,
          "instId": 0,
          "resId": 2
        },
        ...
      ],
      "readOnUpdate": [
        {
          "objId": 3,
          "instId": 0,
          "resId": 2
        },
        ...
      ],
      "observations": [
        {
          "objId": 3,
          "instId": 0,
          "resId": 2
        },
        ...
      ],
      "bindings": [
        {
          "objId": 3202,
          "instId": 0,
          "resId": 5600,
          "type": "property",
          "key": "analog0"
        },
        ...
      ],
      "bootstrapServers": [
        {
          "type": "self",
          "securityMode": "dtls-psk",
          "shortId": 99,
          "lifetime": 60,
          "notificationStoring": true,
          "binding": "UQ"
        },
        ...
      ],
      "firmware": {
	 "checkOnUpdate": false,
	 "instId": 0,
	 "noDns": false,
	 "objId": 5,
	 "protocol": "http",
	 "resId": 7,
	 "setObsAttrs": false
      }
    }
  }
} 

Request Parameters

Name Type Required Description
global Bool True - The profile is accessible across any Orgs.

False - The profile is accessible to the current Org.

Needs SuperOps+ permission level.

name String Yes The name of the profile.
desc String A description of the profile.
readOnRegister Array An array of Read objects.
readOnUpdate Array An array of Read objects.
observations Array An array of Observation objects.
bindings Array An array of Binding objects.

Few Resources and Objects cannot be bound to a property, see Binding Limitations.

bootstrapServers Array An array of Bootstrap Server objects.
bootstrapAcls Array An array of Bootstrap ACL objects
firmware Object A firmware object.
locationDonationEnabled Boolean   This flag allows the GPS location reported by the module to be donated to cellular location decode provider. By default it is set to false.
priority Boolean   Set to true if the read on this path should be executed before others.

Read Object

Name Type Required Description
objId Integer Yes The object ID.
instId Integer The instance ID.
resId Integer The resource ID.
encoding String A CoAP media type.

Observation Object

Name Type Required Description
objId Integer Yes The object ID.
instId Integer The instance ID.
resId Integer The resource ID.
pmin Integer The minimum period.
pmax Integer The maximum period.
gt Float The value must be greater than the specified value.
lt Float The value must be less than the specified value.
st Float The step value.
encoding String A CoAP media type.
priority Boolean   Set to true if the observation on this path should be executed before others.

Binding Object

Name Type Required Description
objId Integer Yes The object ID.
instId Integer Yes The instance ID.
resId Integer Yes The resource ID.
type String Yes The binding type.
key String Yes The binding key.

Bootstrap Server Object

Name Type Required Description
id String   Will be empty when creating new bootstrap server records or updating an existing profile with a new bootstrap server records, but is required when modifying an existing bootstrap server records. Will be returned with lwm2m.profile.find & lwm2m.profile.list commands.
type String Yes The bootstrap server type. Valid options are: 'self' and 'custom'.
url String The URL.
securityMode String Yes The security mode. Valid options are: 'no-sec' and 'dtls-psk'.
identity String The identity.
psk String The pre-shared key.
shortId Integer The short ID.
lifetime Integer Yes The server lifetime. Must be greater than zero.
defaultMinPeriod Integer The default minimum period. If both period options are specified, defaultMinPeriod must be less than the defaultMaxPeriod.
defaultMaxPeriod Integer The default maximum period. If both period options are specified, defaultMaxPeriodmust be greater than the defaultMinPeriod.
disableTimeout Integer   The number of seconds to assign to the bootstrap server disable timeout field (object 1, resource 5). Defaults to 86400 seconds (1 day), if not specified.
notificationStoring Boolean Store notifications. Defaults to false.
binding String Yes The binding to use. Valid options are: 'U' and 'UQ'.
keyShareEndpoint String   The URL of the endpoint of the 3rd party DM server. Can be defined during a lwm2m.profile.create or lwm2m.profile.update API command.
keyShareClientCert String   This is a read only field. This field will be returned by a lwm2m.profile.find API command if the keyShareEndpoint has been previously defined. It will contain the certificate to use with the 3rd party DM server.
keySharedCaId String   This is a read only field. This field will be returned by a lwm2m.profile.find API command if the keyShareEndpoint has been previously defined. It will contain the CA Id to use with the 3rd party DM server.

Bootstrap ACL Object

Name Type Required Description
ownerShortId Integer Yes The owner's short ID.
objId Integer The object ID.
instId Integer The instance ID.
rules Array An array of Bootstrap ACL Rule objects.

Boostrap ACL Rule Object

Name Type Required Description
shortId Integer Yes The short server ID.
read Boolean Read permission. Defaults to false.
write Boolean Write permission. Defaults to false.
exec Boolean Execute permission. Defaults to false.
create Boolean Create permission. Defaults to false.
delete Boolean Delete permission. Defaults to false.

Firmware Object

Name Type Required Description
objId Integer Yes The object ID.
instId Integer Yes The instance ID.
resId Integer Yes The resource ID.
encoding String The encoding.
noDns Boolean If no DNS. Defaults to false (yes DNS).
protocol String The protocol. Valid options are 'http', 'https', 'coap', 'coaps'.
setObsAttrs Boolean   Observe the set PMIN/PMAX of the selected object.

PMIN - Min. time in second between sending notifications for a resource if any of the notify conditions are met

PMAX - Max. time in seconds between sending successive notifications for a resource if none of other notify conditions are satisfied

TR50 Response

If the command is sent successfully a success message and the ID of the profile is returned. Otherwise, an error and error message will be returned.

{
  "1": {
    "success": true,
    "params": {
      "id": "5a6212745758cd51400cdf49"
    }
  }
}

Response Parameters

Name Type Description
id String The ID of the newly created profile.