Developer API - Groups

  1. Group attributes
  2. List of all groups
  3. Find a specific group
  4. Create a new group
  5. Update a group
  6. Delete a group

Group attributes

A group have the following attributes:

Name Type Description
id Integer Record ID
name String Group name
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 groups

Return an array with all groups.

Method and URL format

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

Example of use

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

token = 'API_TOKEN'

uri = URI("https://api.cloudwalk.io/v1/groups?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
   },
   "groups":[
      {
         "group":{
            "id":1,
            "name":"Retail",
            "updated_at":"2015-01-29T20:19:32Z",
            "created_at":"2015-01-29T20:19:32Z",
            "created_by":1,
            "created_via":"interface"
         }
      },
      {
         "group":{
            "id":2,
            "name":"Staging",
            "updated_at":"2015-01-29T20:19:44Z",
            "created_at":"2015-01-29T20:19:44Z",
            "created_by":1,
            "created_via":"interface"
         }
      }
   ]
}

Find a specific group

Return the details of a specific group.

Method and URL format

GET https://api.cloudwalk.io/{version}/groups/{group name}?access_token={token}

Example of use

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

token = 'API_TOKEN'

uri = URI("https://api.cloudwalk.io/v1/groups/Staging?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

{
  "group":{
    "id":2,
    "name":"Staging",
    "updated_at":"2015-01-29T20:19:44Z",
    "created_at":"2015-01-29T20:19:44Z",
    "created_by":1,
    "created_via":"interface"
  }
}

Create a new group

Create a new group.

Method and URL format

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

Example of use

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

token = 'API_TOKEN'

payload = { "name" => "Dev" }

uri = URI("https://api.cloudwalk.io/v1/groups?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

{
  "group":{
    "id":3,
    "name":"Dev",
    "updated_at":"2015-01-29T20:23:08Z",
    "created_at":"2015-01-29T20:23:08Z",
    "created_by":1,
    "created_via":"api"
  }
}

Update a group

Update an existing group.

Method and URL format

PUT https://api.cloudwalk.io/{version}/groups/{group name}?access_token={token}

Example of use

$ curl -X PUT "https://api.cloudwalk.io/v1/groups/Dev?access_token=$TOKEN" \
-d '{"name":"Development"}'
require 'net/http'
require 'json'

token = 'API_TOKEN'

payload = { "name" => "Development" }

uri = URI("https://api.cloudwalk.io/v1/groups/Dev?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

{
  "group":{
    "id":3,
    "name":"Development",
    "updated_at":"2015-01-29T20:25:14Z",
    "created_at":"2015-01-29T20:23:08Z",
    "created_by":1,
    "created_via":"api"
  }
}

Delete a group

Delete a group. To perform this operation the group must be empty (no apps or logical numbers).

Method and URL format

DELETE https://api.cloudwalk.io/{version}/groups/{group name}?access_token={token}

Example of use

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

token = 'API_TOKEN'

uri = URI("https://api.cloudwalk.io/v1/groups/Development?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

{}