Developer API - Metacontents

  1. Metacontent attributes
  2. List of all metacontents
  3. Find a specific metacontent
  4. Create a new metacontent
  5. Update a metacontent
  6. Delete a metacontent

Metacontent attributes

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

A metacontent have the following attributes:

Name Type Description
id Integer Record ID
key String Metacontent key
value JSON Metacontent value
group_id Integer Group ID, if the metacontent belongs to a group
logical_number_id Integer Logical number ID, if the metacontent 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 metacontents

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

Method and URL format

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

Example of use

Group

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

Logical number

$ curl -X GET "https://api.cloudwalk.io/v1/metacontents?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/metacontents?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
   },
   "metacontents":[
      {
         "logical_number_metacontent":{
            "id":2,
            "key":"activation",
            "value":{
               "merchant_id":1000,
               "enabled":true,
               "soft_descriptor":"SAMPLE"
            }
            "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_metacontent":{
            "id":3,
            "key":"extra",
            "value":{
               "document":"11.222.333/0004-55",
               "name":"Merchant Sample"
            },
            "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 metacontent

Return the details of a specific metacontent.

Method and URL format

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

Example of use

Group

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

Logical number

$ curl -X GET "https://api.cloudwalk.io/v1/metacontents/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/metacontents/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_metacontent":{
    "id":3,
    "key":"extra",
    "value":{
       "document":"11.222.333/0004-55",
       "name":"Merchant Sample"
    },
    "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 metacontent

Create a new metacontent.

Method and URL format

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

Example of use

Group

$ curl -X POST "https://api.cloudwalk.io/v1/metacontents?access_token=$TOKEN" \
-d '{"name":"Dev","key":"fees","value":{"one":1.85,"two":2.09,"three":2.18}}'

Logical number

$ curl -X POST "https://api.cloudwalk.io/v1/metacontents?access_token=$TOKEN" \
-d '{"number":"778899","key":"fees","value":{"one":1.85,"two":2.09,"three":2.18}}'
require 'net/http'
require 'json'

token = 'API_TOKEN'

payload = {
  # "name" => "Dev", # Group
  "number" => "778899", # Logical number
  "key" => "fees",
  "value" => {
    "one" => 1.85,
    "two" => 2.09,
    "three" => 2.18
  }
}

uri = URI("https://api.cloudwalk.io/v1/metacontents?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_metacontent":{
    "id":5,
    "key":"fees",
    "value":{
      "one":1.85,
      "two":2.09,
      "three":2.18
    },
    "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 metacontent

Update an existing metacontent.

Method and URL format

PUT https://api.cloudwalk.io/{version}/metacontents/{metacontent_id}?access_token={token}

Example of use

Group

$ curl -X PUT "https://api.cloudwalk.io/v1/metacontents/1?access_token=$TOKEN" \
-d '{"name":"Dev","key":"fees","value":{"one":1.90,"two":2.15,"three":2.25}}'

Logical number

$ curl -X PUT "https://api.cloudwalk.io/v1/metacontents/3?access_token=$TOKEN" \
-d '{"number":"778899","fees","value":{"one":1.90,"two":2.15,"three":2.25}}'
require 'net/http'
require 'json'

token = 'API_TOKEN'

payload = {
  # "name" => "Dev", # Group
  "number" => "778899",
  "key" => "fees",
  "value" => {
    "one" => 1.90,
    "two" => 2.15,
    "three" => 2.25
  }
}

uri = URI("https://api.cloudwalk.io/v1/metacontents/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_metacontent":{
    "id":3,
    "key":"fees",
    "value":{
      "one":1.90,
      "two":2.15,
      "three":2.25
    },
    "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 metacontent

Delete a metacontent.

Method and URL format

DELETE https://api.cloudwalk.io/{version}/metacontents/{metacontent_id}?access_token={token}

Example of use

Group

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

Logical number

$ curl -X DELETE "https://api.cloudwalk.io/v1/metacontents/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/metacontents/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

{}