This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const config: Configuration = new Configuration({ | |
username: LOB_API_KEY, | |
}); | |
const postcardsApi = new PostcardsApi(config); | |
for (let item of dbdata) { | |
await postcardsApi.cancel(item.id); | |
/* Remove the record from your database */ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const config: Configuration = new Configuration({ | |
username: "test_XXXXXXXXX", | |
}); | |
const postCardExample: PostcardEditable = { | |
to: { | |
name: "HARRY ZHANG", | |
address_line1: "210 KING STREET", | |
address_city: "SAN FRANCISCO", | |
address_state: "CA", | |
address_zip: "94107", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const config: Configuration = new Configuration({ | |
username: "test_XXXXXXXXX", | |
}); | |
const postcardsApi = new PostcardsApi(config); | |
const listOfPostcards = await postcardsApi.list( | |
undefined, | |
undefined, | |
undefined, | |
undefined, | |
undefined, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const config: Configuration = new Configuration({ | |
username: "test_XXXXXXXXX", | |
}); | |
const postCardExample: PostcardEditable = { | |
to: { | |
company: "HARRY ZHANG", | |
address_line1: "210 KING STREET", | |
address_city: "SAN FRANCISCO", | |
address_state: "CA", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "psc_9303c02190b14023", | |
"description": "First Postcard", | |
"metadata": {}, | |
"to": { | |
"id": "adr_db9d33f9264e44f7", | |
"description": null, | |
"name": "HARRY ZHANG", | |
"company": null, | |
"phone": null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.company.app; | |
import com.lob.api.ApiClient; | |
import com.lob.api.ApiException; | |
import com.lob.api.Configuration; | |
import com.lob.api.auth.*; | |
import com.lob.model.*; | |
import com.lob.api.client.PostcardsApi; | |
public class App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php require __DIR__ . '/vendor/autoload.php'; | |
$lob = new \Lob\Lob('<TEST_API_KEY'); | |
$postcard = $lob->postcards()->create(array( | |
"description" => "First Postcard", | |
"to[name]" => "HARRY ZHANG", | |
"to[address_line1]" => "210 KING STREET", | |
"to[address_city]" => "SAN FRANCISCO", | |
"to[address_state]" => "CA", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'lob.rb' | |
require 'pp' | |
lob = Lob::Client.new(api_key: "<TEST_API_KEY>") | |
pp lob.postcards.create( | |
description: "First Postcard", | |
to: { | |
name: "Harry Zhang", | |
address_line1: "210 King Street", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lob | |
lob.api_key = "<YOUR_TEST_KEY>" | |
postcard = lob.Postcard.create( | |
description = "First Postcard", | |
to_address = { | |
"name": "Harry Zhang", | |
"address_line1": "210 King Street", | |
"address_city": "San Francisco", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Configuration, Postcard, PostcardsApi, PostcardEditable, AddressEditable } from "@lob/lob-typescript-sdk" | |
async function demo() { | |
const config: Configuration = new Configuration({ | |
username: "<YOUR_TEST_KEY>" | |
}) | |
const postcardData : PostcardEditable = new PostcardEditable({ | |
to: new AddressEditable({ | |
name: "Harry Zhang", |
NewerOlder