with Slack and Selling Partner API (SP-API)?
Emit new event when a new inbound shipment to FBA is created. See the documentation
Emit new event when a new order is created in Amazon Seller Central. See the documentation
Emit new events on new Slack interactivity events sourced from Block Kit interactive elements, Slash commands, or Shortcuts
Emit new event when a specific keyword is mentioned in a channel
Retrieves inventory summaries from Amazon fulfillment centers to monitor stock availability. See the documentation
Suspend the workflow until approved by a Slack message. See the documentation
Retrieves a list of orders based on a specified date range, buyer email, or order ID. See the documentation
The Pipedream app for Slack enables you to build event-driven workflows that interact with the Slack API. Once you authorize the app's access to your workspace, you can use Pipedream workflows to perform common Slack actions or write your own code against the Slack API.
The Pipedream app for Slack is not a typical app. You don't interact with it directly as a bot, and it doesn't add custom functionality to your workspace out of the box. It makes it easier to automate anything you'd typically use the Slack API for, using Pipedream workflows.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
slack_v2: {
type: "app",
app: "slack_v2",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://slack.com/api/users.profile.get`,
headers: {
Authorization: `Bearer ${this.slack_v2.$auth.oauth_access_token}`,
},
})
},
})
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
amazon_selling_partner: {
type: "app",
app: "amazon_selling_partner",
}
},
async run({steps, $}) {
// Define the mapping between Seller Central URLs (from your App Config) and SP-API Endpoints
const getEndpoint = (sellerCentralUrl) => {
const na = "https://sellingpartnerapi-na.amazon.com";
const eu = "https://sellingpartnerapi-eu.amazon.com";
const fe = "https://sellingpartnerapi-fe.amazon.com";
const map = {
// North America
"https://sellercentral.amazon.com": na,
"https://sellercentral.amazon.ca": na,
"https://sellercentral.amazon.com.mx": na,
"https://sellercentral.amazon.com.br": na,
// Europe (The Big 5 often share one URL, but newer ones have specific URLs)
"https://sellercentral-europe.amazon.com": eu,
"https://sellercentral.amazon.com.be": eu,
"https://sellercentral.amazon.nl": eu,
"https://sellercentral.amazon.pl": eu,
"https://sellercentral.amazon.se": eu,
"https://sellercentral.amazon.com.tr": eu,
// India (Uses EU endpoint)
"https://sellercentral.amazon.in": eu,
// Far East
"https://sellercentral.amazon.sg": fe,
"https://sellercentral.amazon.com.au": fe,
"https://sellercentral.amazon.co.jp": fe,
};
return map[sellerCentralUrl];
};
// 1. Get the Marketplace URL selected by the user in the App Connection
const marketplaceUrl = this.amazon_selling_partner.$auth.marketplace;
// 2. Resolve the correct SP-API Endpoint
const apiEndpoint = getEndpoint(marketplaceUrl);
if (!apiEndpoint) {
throw new Error(`Could not map Seller Central URL (${marketplaceUrl}) to an SP-API Endpoint.`);
}
// 3. Make the request
return await axios($, {
url: `${apiEndpoint}/inbound/fba/2024-03-20/inboundPlans`,
headers: {
"x-amz-access-token": `${this.amazon_selling_partner.$auth.oauth_access_token}`,
},
});
},
})