Skip to content

Latest commit

 

History

History
51 lines (40 loc) · 858 Bytes

USAGE.md

File metadata and controls

51 lines (40 loc) · 858 Bytes
require 'dub'

s = ::OpenApiSDK::Dub.new(
      security: ::OpenApiSDK::Shared::Security.new(
        token: "DUB_API_KEY",
      ),
    )

req = ::OpenApiSDK::Operations::CreateLinkRequestBody.new(
  url: "https://google.com",
  external_id: "123456",
  tag_ids: [
    "clux0rgak00011...",
  ],
)

res = s.links.create(req)

if ! res.link_schema.nil?
  # handle response
end
require 'dub'

s = ::OpenApiSDK::Dub.new(
      security: ::OpenApiSDK::Shared::Security.new(
        token: "DUB_API_KEY",
      ),
    )

req = ::OpenApiSDK::Operations::UpsertLinkRequestBody.new(
  url: "https://google.com",
  external_id: "123456",
  tag_ids: [
    "clux0rgak00011...",
  ],
)

res = s.links.upsert(req)

if ! res.link_schema.nil?
  # handle response
end