Create a feedback

With the createFeedback mutation you can easily create a feedback in your Cycle workspace from wherever you want (e.g: mobile app, web app, ...)

1. Create a personal access token

Create a personal access token by triggering the createAccessToken mutation and use the received token in your authorization bearer (don't forget put your login bearer token before triggering the mutation. See Queries and mutations).

mutation createToken {
  createAccessToken(label: "In App Integration") {
    id
    token
    label
  }
}

2. Use the createFeedback mutation

The createFeedback mutation requires a productId parameter. To get one, you can use the me query and use the first productId from your products list if you have multiple. If you don't have any, try to create a workspace first with our get-started path.

query me {
    me {
        id
        products {
            edges {
                node {
                    id
                    name
                }
            }
        }
    }
}

Once we have our productId, we can trigger the createFeedback mutation

mutation createFeedback {
    createFeedback(
        productId: "<productId>"
        title: "my first feedback from the api"
        customer: "customer@mail.com"
        source: { sourceWeb: { url: "https://www.mysupersite.com" } }
    ) {
        id
        title
        status {
            id
            value
        }
        customer {
            id
            email
        }
    }
}

3. Create Feedback linked to company

A feedback can be directly linked to a company with the parameter company: CompanyInput

input CompanyInput {
  name: DefaultString! # Name is required to create a company when no company found with externalId
  arr: Float
  numberOfEmployees: Int
  externalIds: ExternalCompanyInput
}

input ExternalCompanyInput {
  zendesk: DefaultString
  hubspot: DefaultString
  intercom: DefaultString
  pipedrive: DefaultString
  snowflake: DefaultString
  custom: DefaultString
}

mutation createFeedback {
    createFeedback(
        productId: "<productId>"
        title: "my first feedback from the api"
        company: { name: "XXX", externalIds: { zendesk: "YYY" } }
    ) {
        id
        title
        status {
            id
            value
        }
        customer {
            id
            email
        }
    }
}

4. Integrate the mutation in your app

Work in progress...

Last updated