Skip to content

Instantly share code, notes, and snippets.

Avatar

Lob Developers lobot

View GitHub Profile
View qs-java-code
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
@lobot
lobot / help-center-mass-delete-cancel-yourdb-typescript
Created Jul 6, 2022
help-center-mass-delete-cancel-yourdb-typescript
View help-center-mass-delete-cancel-yourdb-typescript
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 */
}
@lobot
lobot / help-center-mass-delete-create-yourdb-typescript
Created Jul 6, 2022
help-center-mass-delete-create-yourdb-typescript
View help-center-mass-delete-create-yourdb-typescript
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",
@lobot
lobot / help-center-mass-delete-cancel-typescript
Created Jul 5, 2022
help-center-mass-delete-cancel-typescript
View help-center-mass-delete-cancel-typescript
const config: Configuration = new Configuration({
username: "test_XXXXXXXXX",
});
const postcardsApi = new PostcardsApi(config);
const listOfPostcards = await postcardsApi.list(
undefined,
undefined,
undefined,
undefined,
undefined,
@lobot
lobot / help-center-mass-delete-create-typescript
Created Jul 5, 2022
help-center-mass-delete-create-typescript
View help-center-mass-delete-create-typescript
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",
View qs-response
{
"id": "psc_9303c02190b14023",
"description": "First Postcard",
"metadata": {},
"to": {
"id": "adr_db9d33f9264e44f7",
"description": null,
"name": "HARRY ZHANG",
"company": null,
"phone": null,
View qs-php-code
<?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",
View qs-ruby-code
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",
View qs-python-code
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",
View qs-ts-code
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",