curl "https://api.goshippo.com/carrier_accounts/2ccf5af209bb484cb20190d9cadbb61c/signin/initiate?redirect_uri=https://client.example.com/cb&state=SplxlOBeZQQYbYS6WxSbIA" \
-H "Authorization: ShippoToken <API_TOKEN>"import shippo
s = shippo.Shippo(
api_key_header='ShippoToken <API_TOKEN>',
shippo_api_version='2018-02-08',
)
res = s.carrier_accounts.initiate_oauth2_signin(carrier_account_object_id='<id>', redirect_uri='https://enlightened-mortise.com/')
if res is not None:
# handle response
passimport { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken <API_TOKEN>",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.carrierAccounts.initiateOauth2Signin("<id>", "https://enlightened-mortise.com/");
// Handle the result
console.log(result);
}
run();using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken <API_TOKEN>",
shippoApiVersion: "2018-02-08"
);
InitiateOauth2SigninRequest req = new InitiateOauth2SigninRequest() {
CarrierAccountObjectId = "<id>",
RedirectUri = "https://enlightened-mortise.com/",
};
var res = await sdk.CarrierAccounts.InitiateOauth2SigninAsync(req);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use Shippo\API;
use Shippo\API\Models\Operations;
$sdk = API\Shippo::builder()
->setSecurity(
'ShippoToken <API_TOKEN>'
)
->setShippoApiVersion('2018-02-08')
->build();
$request = new Operations\InitiateOauth2SigninRequest(
carrierAccountObjectId: '<id>',
redirectUri: 'https://enlightened-mortise.com/',
);
$response = $sdk->carrierAccounts->initiateOauth2Signin(
request: $request
);
if ($response->statusCode === 200) {
// handle response
}package hello.world;
import com.goshippo.shippo_sdk.Shippo;
import com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseBody;
import com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseResponseBody;
import com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninResponseBody;
import com.goshippo.shippo_sdk.models.operations.InitiateOauth2SigninResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws InitiateOauth2SigninResponseBody, InitiateOauth2SigninCarrierAccountsResponseResponseBody, InitiateOauth2SigninCarrierAccountsResponseBody, Exception {
Shippo sdk = Shippo.builder()
.apiKeyHeader("ShippoToken <API_TOKEN>")
.shippoApiVersion("2018-02-08")
.build();
InitiateOauth2SigninResponse res = sdk.carrierAccounts().initiateOauth2Signin()
.carrierAccountObjectId("<id>")
.redirectUri("https://enlightened-mortise.com/")
.state("Florida")
.shippoApiVersion("2018-02-08")
.call();
// handle response
}
}const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.goshippo.com/carrier_accounts/{CarrierAccountObjectId}/signin/initiate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.goshippo.com/carrier_accounts/{CarrierAccountObjectId}/signin/initiate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.goshippo.com/carrier_accounts/{CarrierAccountObjectId}/signin/initiate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"title": "Missing required parameter",
"detail": "redirect_uri"
}{
"title": "Unsupported OAuth Carrier Account",
"detail": "The carrier account 3c49f998b1234a2097ea0911a7e95bea does not support OAuth authorization"
}{
"title": "Carrier Account not found",
"detail": "Carrier Account not found for object_id: 3c49f998b1234a2097ea0911a7e95bea"
}Connect an existing carrier account using OAuth 2.0
Used by client applications to setup or reconnect an existing carrier account with carriers that support OAuth 2.0
curl "https://api.goshippo.com/carrier_accounts/2ccf5af209bb484cb20190d9cadbb61c/signin/initiate?redirect_uri=https://client.example.com/cb&state=SplxlOBeZQQYbYS6WxSbIA" \
-H "Authorization: ShippoToken <API_TOKEN>"import shippo
s = shippo.Shippo(
api_key_header='ShippoToken <API_TOKEN>',
shippo_api_version='2018-02-08',
)
res = s.carrier_accounts.initiate_oauth2_signin(carrier_account_object_id='<id>', redirect_uri='https://enlightened-mortise.com/')
if res is not None:
# handle response
passimport { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken <API_TOKEN>",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.carrierAccounts.initiateOauth2Signin("<id>", "https://enlightened-mortise.com/");
// Handle the result
console.log(result);
}
run();using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken <API_TOKEN>",
shippoApiVersion: "2018-02-08"
);
InitiateOauth2SigninRequest req = new InitiateOauth2SigninRequest() {
CarrierAccountObjectId = "<id>",
RedirectUri = "https://enlightened-mortise.com/",
};
var res = await sdk.CarrierAccounts.InitiateOauth2SigninAsync(req);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use Shippo\API;
use Shippo\API\Models\Operations;
$sdk = API\Shippo::builder()
->setSecurity(
'ShippoToken <API_TOKEN>'
)
->setShippoApiVersion('2018-02-08')
->build();
$request = new Operations\InitiateOauth2SigninRequest(
carrierAccountObjectId: '<id>',
redirectUri: 'https://enlightened-mortise.com/',
);
$response = $sdk->carrierAccounts->initiateOauth2Signin(
request: $request
);
if ($response->statusCode === 200) {
// handle response
}package hello.world;
import com.goshippo.shippo_sdk.Shippo;
import com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseBody;
import com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseResponseBody;
import com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninResponseBody;
import com.goshippo.shippo_sdk.models.operations.InitiateOauth2SigninResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws InitiateOauth2SigninResponseBody, InitiateOauth2SigninCarrierAccountsResponseResponseBody, InitiateOauth2SigninCarrierAccountsResponseBody, Exception {
Shippo sdk = Shippo.builder()
.apiKeyHeader("ShippoToken <API_TOKEN>")
.shippoApiVersion("2018-02-08")
.build();
InitiateOauth2SigninResponse res = sdk.carrierAccounts().initiateOauth2Signin()
.carrierAccountObjectId("<id>")
.redirectUri("https://enlightened-mortise.com/")
.state("Florida")
.shippoApiVersion("2018-02-08")
.call();
// handle response
}
}const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.goshippo.com/carrier_accounts/{CarrierAccountObjectId}/signin/initiate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.goshippo.com/carrier_accounts/{CarrierAccountObjectId}/signin/initiate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.goshippo.com/carrier_accounts/{CarrierAccountObjectId}/signin/initiate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"title": "Missing required parameter",
"detail": "redirect_uri"
}{
"title": "Unsupported OAuth Carrier Account",
"detail": "The carrier account 3c49f998b1234a2097ea0911a7e95bea does not support OAuth authorization"
}{
"title": "Carrier Account not found",
"detail": "Carrier Account not found for object_id: 3c49f998b1234a2097ea0911a7e95bea"
}Authorizations
API key authentication using the ShippoToken scheme. Format: Authorization: ShippoToken <API_TOKEN> Example: Authorization: ShippoToken shippo_live_abc123
Headers
Optional string used to pick a non-default API version to use. See our API version guide.
"2018-02-08"
Path Parameters
The carrier account ID (UUID) to start a signin process.
Query Parameters
Callback URL. The URL that tells the authorization server where to send the user back to after they approve the request.
A random string generated by the consuming application and included in the request to prevent CSRF attacks. The consuming application checks that the same value is returned after the user authorizes Shippo.
Response
Redirects the browser to the carrier login page, with the needed parameters
Was this page helpful?