Developer API - Parameters

  1. Parameter attributes
  2. List of all parameters
  3. Find a specific parameter
  4. Create a new parameter
  5. Update a parameter
  6. Delete a parameter

Parameter attributes

A parameter can reference a logical number or a group. What defines the type of parameter being handled is the definition of the properties number (refer to a logical number) or name (refer to a group).

A parameter have the following attributes:

Name Type Description
id Integer Record ID
key String Parameter key
value String Parameter value
description String Parameter description
group_id Integer Group ID, if the parameter belongs to a group
logical_number_id Integer Logical number ID, if the parameter belongs to a logical number
updated_at String Timestamp in ISO 8601 format
created_at String Timestamp in ISO 8601 format
created_by Integer User ID that created the record
created_via String Channel used to create the record (Interface or API)

List of all parameters

Return an array with all parameters of a group or logical number.

Method and URL format

GET https://api.cloudwalk.io/{version}/parameters?access_token={token}

Example of use

Group

$ curl -X GET "https://api.cloudwalk.io/v1/parameters?access_token=$TOKEN" \
-d '{"name":"Dev"}'

Logical number

$ curl -X GET "https://api.cloudwalk.io/v1/parameters?access_token=$TOKEN" \
-d '{"number":"778899"}'
require 'net/http'
require 'json'

token = 'API_TOKEN'

payload = {
  # "name" => "Dev" # Group
  "number" => "778899" # Logical number
}

uri = URI("https://api.cloudwalk.io/v1/parameters?access_token=#{token}")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)
request.body = payload.to_json

res = http.request(request)

puts "Response #{res.code} #{res.message}: #{res.body}"

Example of response

{
   "pagination":{
      "page":1,
      "total_pages":1,
      "entries":2,
      "total_entries":2
   },
   "parameters":[
      {
         "logical_number_parameter":{
            "id":2,
            "key":"host_ip",
            "value":"10.0.0.1",
            "description":"Host IP",
            "group_id":null,
            "logical_number_id":4,
            "updated_at":"2015-03-02T22:51:40Z",
            "created_at":"2015-03-02T22:51:40Z",
            "created_by":1,
            "created_via":"api"
         }
      },
      {
         "logical_number_parameter":{
            "id":3,
            "key":"retry",
            "value":"2",
            "description":"Retry attempts",
            "group_id":null,
            "logical_number_id":4,
            "updated_at":"2015-03-02T11:26:30Z",
            "created_at":"2015-03-02T11:26:30Z",
            "created_by":1,
            "created_via":"interface"
         }
      }
   ]
}

Find a specific parameter

Return the details of a specific parameter.

Method and URL format

GET https://api.cloudwalk.io/{version}/parameters/{parameter_id}?access_token={token}

Example of use

Group

$ curl -X GET "https://api.cloudwalk.io/v1/parameters/1?access_token=$TOKEN" \
-d '{"name":"Dev"}'

Logical number

$ curl -X GET "https://api.cloudwalk.io/v1/parameters/3?access_token=$TOKEN" \
-d '{"number":"778899"}'
require 'net/http'
require 'json'

token = 'API_TOKEN'

payload = {
  # "name" => "Dev" # Group
  "number" => "778899" # Logical number
}

uri = URI("https://api.cloudwalk.io/v1/parameters/1?access_token=#{token}")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)
request.body = payload.to_json

res = http.request(request)

puts "Response #{res.code} #{res.message}: #{res.body}"

Example of response

{
  "logical_number_parameter":{
    "id":3,
    "key":"retry",
    "value":"2",
    "description":"Retry attempts",
    "group_id":null,
    "logical_number_id":4,
    "updated_at":"2015-03-02T11:26:30Z",
    "created_at":"2015-03-02T11:26:30Z",
    "created_by":1,
    "created_via":"interface"
  }
}

Create a new parameter

Create a new parameter.

Method and URL format

POST https://api.cloudwalk.io/{version}/parameters?access_token={token}

Example of use

Group

$ curl -X POST "https://api.cloudwalk.io/v1/parameters?access_token=$TOKEN" \
-d '{"name":"Dev","key":"max_parcels","value":"6","description":"Max parcels allowed"}'

Logical number

$ curl -X POST "https://api.cloudwalk.io/v1/parameters?access_token=$TOKEN" \
-d '{"number":"778899","key":"min_value","value":"1.50","description":"Min value allowed"}'
require 'net/http'
require 'json'

token = 'API_TOKEN'

payload = {
  # "name" => "Dev", # Group
  "number" => "778899", # Logical number
  "key" => "min_value",
  "value" => "1.50",
  "description" => "Min value allowed"
}

uri = URI("https://api.cloudwalk.io/v1/parameters?access_token=#{token}")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri.request_uri)
request.body = payload.to_json

res = http.request(request)

puts "Response #{res.code} #{res.message}: #{res.body}"

Example of response

{
  "logical_number_parameter":{
    "id":5,
    "key":"min_value",
    "value":"1.50",
    "description":"Min value allowed",
    "group_id":null,
    "logical_number_id":4,
    "updated_at":"2015-03-02T11:58:53Z",
    "created_at":"2015-03-02T11:58:53Z",
    "created_by":1,
    "created_via":"api"
  }
}

Update a parameter

Update an existing parameter.

Method and URL format

PUT https://api.cloudwalk.io/{version}/parameters/{parameter_id}?access_token={token}

Example of use

Group

$ curl -X PUT "https://api.cloudwalk.io/v1/parameters/1?access_token=$TOKEN" \
-d '{"name":"Dev","key":"host_port","value":"8088","description":"Host port"}'

Logical number

$ curl -X PUT "https://api.cloudwalk.io/v1/parameters/3?access_token=$TOKEN" \
-d '{"number":"778899","key":"retry","value":"3","description":"Retry attempts"}'
require 'net/http'
require 'json'

token = 'API_TOKEN'

payload = {
  # "name" => "Dev", # Group
  "key" => "retry",
  "number" => "778899",
  "value" => "3",
  "description" => "Retry attempts"
}

uri = URI("https://api.cloudwalk.io/v1/parameters/3?access_token=#{token}")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Put.new(uri.request_uri)
request.body = payload.to_json

res = http.request(request)

puts "Response #{res.code} #{res.message}: #{res.body}"

Example of response

{
  "logical_number_parameter":{
    "id":3,
    "key":"retry",
    "value":"3"
    "description":"Retry attempts",
    "group_id":null,
    "logical_number_id":4,
    "updated_at":"2015-03-02T12:36:39Z"
    "created_at":"2015-03-02T11:26:30Z",
    "created_by":1,
    "created_via":"interface"
  }
}

Delete a parameter

Delete a parameter.

Method and URL format

DELETE https://api.cloudwalk.io/{version}/parameters/{parameter_id}?access_token={token}

Example of use

Group

$ curl -X DELETE "https://api.cloudwalk.io/v1/parameters/1?access_token=$TOKEN" \
-d '{"name":"Dev"}'

Logical number

$ curl -X DELETE "https://api.cloudwalk.io/v1/parameters/3?access_token=$TOKEN" \
-d '{"number":"778899"}'
require 'net/http'
require 'json'

token = 'API_TOKEN'

payload = {
  # "name" => "Dev" # Group
  "number" => "778899" # Logical number
}

uri = URI("https://api.cloudwalk.io/v1/parameters/1?access_token=#{token}")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(uri.request_uri)
request.body = payload.to_json

res = http.request(request)

puts "Response #{res.code} #{res.message}: #{res.body}"

Example of response

{}