Cycle API
CycleStatusChangelog
  • Cycle API
  • Introduction
    • About Cycle
    • Data model
  • The graphql API
    • How to start
    • Authentication
    • Node interface
    • Pagination
    • Webhooks
    • Limitations
    • Graphql Schema
    • Examples
  • Company
    • Company Attribute
    • List Company attributes by product
    • Create a company
    • Update a company attribute value
  • Practical use case: the feedback form
    • Create a feedback
    • Advanced: use your properties
Powered by GitBook
On this page
  • 1. Create a personal access token
  • 2. Use the createFeedback mutation
  • 3. Create Feedback linked to company
  • 4. Integrate the mutation in your app
  1. Practical use case: the feedback form

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, ...)

PreviousUpdate a company attribute valueNextAdvanced: use your properties

Last updated 11 months ago

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 ).

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 .

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...

get-started path
Queries and mutations