with Afosto and Peach?
Send a predefined message to a contact within the Peach app. See the documentation
import { graphQLClient, gql } from '@afosto/graphql-client';
export default defineComponent({
props: {
afosto: {
type: "app",
app: "afosto",
}
},
async run({steps, $}) {
graphQLClient.setAuthorizationHeader(this.afosto.$auth.auth_token);
const query = gql`query GetChannelData { channel { name type logo locale favicon business { name messaging { sender { name address } } } branding { colors { primary text } style } links { type value } } }`;
return await graphQLClient.request(query);
},
})
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
peach: {
type: "app",
app: "peach",
}
},
async run({steps, $}) {
const data = {
"name": `John Smith`,
"phone_number": `+919876543210`,
"email": `john.smith@example.com`,
}
return await axios($, {
method: "post",
url: `https://app.trypeach.io/api/v1/contacts`,
headers: {
"Authorization": `${this.peach.$auth.api_token}`,
},
data,
})
},
})