Developer API - Logical numbers

  1. Logical number attributes
  2. List of all logical numbers
  3. Find a specific logical number
  4. Create a new logical number
  5. Update a logical number
  6. Delete a logical number

Logical number attributes

A logical number have the following attributes:

Name Type Description
id Integer Record ID
number String Logical number
group_id Integer Group ID that the logical number belongs
app_version_ids Integer (array) List of app version IDs (from group) that the logical number has access
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 logical numbers

Return an array with all logical numbers.

Method and URL format

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

Example of use

$ curl -X GET "https://api.cloudwalk.io/v1/logical_numbers?access_token=$TOKEN"
require 'net/http'

token = 'API_TOKEN'

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

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

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

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
   },
   "logical_numbers":[
      {
         "logical_number":{
            "id":1,
            "number":"112233",
            "group_id":null,
            "app_version_ids":[],
            "updated_at":"2015-03-02T18:59:14Z",
            "created_at":"2015-03-02T18:59:14Z",
            "created_by":1,
            "created_via":"interface"
         }
      },
      {
         "logical_number":{
            "id":2,
            "number":"445566",
            "group_id":null,
            "app_version_ids":[],
            "updated_at":"2015-03-02T18:59:29Z",
            "created_at":"2015-03-02T18:59:29Z",
            "created_by":1,
            "created_via":"interface"
         }
      }
   ]
}

Find a specific logical number

Return the details of a specific logical number.

Method and URL format

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

Example of use

$ curl -X GET "https://api.cloudwalk.io/v1/logical_numbers/445566?access_token=$TOKEN"
require 'net/http'

token = 'API_TOKEN'

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

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

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

res = http.request(request)

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

Example of response

{
  "logical_number":{
    "id":2,
    "number":"445566",
    "group_id":null,
    "app_version_ids":[],
    "updated_at":"2015-03-02T18:59:29Z",
    "created_at":"2015-03-02T18:59:29Z",
    "created_by":1,
    "created_via":"interface"
  }
}

Create a new logical number

Create a new logical number.

Method and URL format

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

Example of use

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

token = 'API_TOKEN'

payload = { "number" => "778899" }

uri = URI("https://api.cloudwalk.io/v1/logical_numbers?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":{
    "id":3,
    "number":"778899",
    "group_id":null,
    "updated_at":"2015-03-02T19:17:19Z",
    "created_at":"2015-03-02T19:17:19Z",
    "created_by":1,
    "created_via":"api"
  }
}

Update a logical number

Update an existing logical number.

Method and URL format

PUT https://api.cloudwalk.io/{version}/logical_numbers/{logical_number}?access_token={token}

Example of use

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

token = 'API_TOKEN'

payload = { "number" => "889900" }

uri = URI("https://api.cloudwalk.io/v1/logical_numbers/778899?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":{
    "id":3,
    "number":"889900",
    "group_id":null,
    "app_version_ids":[],
    "updated_at":"2015-03-02T19:20:27Z",
    "created_at":"2015-03-02T19:17:19Z",
    "created_by":1,
    "created_via":"api"
  }
}

Delete a logical number

Delete a logical number. The equipment with the deleted logical number will not be able to download CloudWalk apps.

Method and URL format

DELETE https://api.cloudwalk.io/{version}/logical_numbers/{logical_number}?access_token={token}

Example of use

$ curl -X DELETE "https://api.cloudwalk.io/v1/logical_numbers/889900?access_token=$TOKEN"
require 'net/http'

token = 'API_TOKEN'

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

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

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

res = http.request(request)

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

Example of response

{}