• CLI

sdk
  1. Help Center
  2. CLI
  3. Developer Guide
  4. Mapping Between API and SDK
  5. Java
  6. SMN

SMN

Interface

method

API URL

Topic

osclient.notification().topics().create("topic-name", "display-name")

POST /v2/{project_id}/notifications/topics

osclient.notification().topics().updateDisplayName(topicUrn, displayName)

PUT /v2/{project_id}/notifications/topics/{topic_urn}

osclient.notification().topics().delete(topicUrn)

DELETE /v2/{project_id}/notifications/topics/{topic_urn}

osclient.notification().topics().list(100, 0)

GET /v2/{project_id}/notifications/topics?offset=0&limit=2

osclient.notification().topics().get(topicUrn)

GET /v2/{project_id}/notifications/topics/{topic_urn}

osclient.notification().topics().getTopicAttributes(topicUrn)

GET /v2/{project_id}/notifications/topics/{topic_urn}/attributes?name=access_policy

osclient.notification().topics().getTopicAttribute(topicUrn, TopicAttributeName.Introduction)

/v2/{project_id}/notifications/topics/{topic_urn}/attributes?name=access_policy

osclient.notification().topics().updateTopicAttribute(topicUrn, TopicAttributeName.Introduction, "sdk-unittest")

PUT /v2/{project_id}/notifications/topics/{topic_urn}/attributes/{attributes_name}

osclient.notification().topics() .deleteTopicAttribute(topicUrn, TopicAttributeName.Introduction);

DELETE /v2/{project_id}/notifications/topics/{topic_urn}/attributes/{attributes_name}

osclient.notification().topics().deleteTopicAttributes(topicUrn)

DELETE /v2/{project_id}/notifications/topics/{topic_urn}/attributes

Subscribe

osclient.notification().subscriptions().list(100, 0)

GET /v2/{project_id}/notifications/subscriptions?offset=0&limit=2

osclient.notification().subscriptions().listByTopic("topic-urn", 100, 0)

GET /v2/{project_id}/notifications/topics/{topic_urn}/subscriptions?offset=0&limit=10

osclient.notification().subscriptions().subscribe(subscribe)

POST /v2/{project_id}/notifications/topics/{topic_urn}/subscriptions

osclient.notification().subscriptions().unsubscribe("subscription-urn")

DELETE /v2/{project_id}/notifications/subscriptions/{subscription_urn}

Message template

osclient.notification().messageTemplates().create(create)

POST /v2/{project_id}/notifications/message_template

osclient.notification().messageTemplates().updateContent("message-template-id", "Hello, {user}")

PUT /v2/{project_id}/notifications/message_template/{message_template_Id}

osclient.notification().messageTemplates().delete("message-template-id")

DELETE /v2/{project_id}/notifications/message_template/{message_template_id}

osclient.notification().messageTemplates().list(options);

GET /v2/{project_id}/notifications/message_template

osclient.notification().messageTemplates().get("message-template-id")

GET /v2/{project_id}/notifications/message_template/{message_template_id}

Message

osclient.notification().messages().publish("topic-urn", "subject", "message-content")

POST /v2/{project_id}/notifications/topics/{topic_urn}/publish

osclient.notification().messages().publish("topic-urn", structuredMessage)

POST /v2/{project_id}/notifications/topics/{topic_urn}/publish

osclient.notification().messages().publish("topic-urn", templatedMessage)

POST /v2/{project_id}/notifications/topics/{topic_urn}/publish

SMS

osclient.notification().sms().send("15659767757", "Hello, sms", null)

POST /v2/{project_id}/notifications/sms