-
Notifications
You must be signed in to change notification settings - Fork 0
Misc
alex [dot] kramer [at] g_m_a_i_l [dot] com edited this page Mar 1, 2020
·
2 revisions
- normalize DB schema (e.g. make appropriate columns non-nullabe)
- customer tags are broken up by spaces
Service | Login |
---|---|
ZD | [email protected], [email protected] |
the-difference.heroku.com | [email protected] |
the-difference.herokuapp.com/admin | [email protected] |
Stripe | ??? |
https://support.zendesk.com/hc/en-us/articles/204890268-Creating-webhooks-with-the-HTTP-target
- Go to: https://thedifference.zendesk.com/agent/admin/extensions
- Click "add target"
- Select "HTTP target"
- Set URL to https://the-difference-api.herokuapp.com/api/webhook/zendesk/
- Set Method to
PATCH
- Set Content type to
JSON
- Create a trigger: https://thedifference.zendesk.com/rules/new?filter=trigger
- Set title to Notify TD API when ticket marked solved
- Add the condition
Ticket: Status
+is
+Solved
- Add the action
Notifications: Notify target
and select the target created above. - Add JSON body:
{
"ticket_id": "{{ticket.id}}",
"user_pk": "{{ticket.requester.external_id}}"
}
https://developer.zendesk.com/rest_api/docs/
Env Var | Value |
---|---|
ZENDESK_API_BASE_URL | https://thedifference.zendesk.com/api/v2/ |
ZENDESK_FIND_USER_URL | https://thedifference.zendesk.com/api/v2/users/search.json?query= |
ZENDESK_REQUEST_URL | https://thedifference.zendesk.com/api/v2/requests.json |
ZENDESK_TICKET_URL | https://thedifference.zendesk.com/agent/tickets/ |
- Enable Password Access and Token Access on https://thedifference.zendesk.com/agent/admin/api/settings
- Set new ZENDESK_AGENT_LOGIN, ZENDESK_AGENT_PASSWORD, ZENDESK_API_TOKEN in Config Vars on https://dashboard.heroku.com/apps/the-difference-api/settings
- Add a user field on https://thedifference.zendesk.com/agent/admin/user_fields
- Type: Numeric
- Field title:
credits
- Field key:
credits
- Field description:
Number of available call credits.
# brew install angular
npm install -g npm
npm install -g @angular/cli
npm install
ng build
ng serve
# Navigate browser to http://localhost:4200
- Set stripe to test mode by changing Heroku config var
STRIPE_LIVE_MODE
toFalse
(https://dashboard.heroku.com/apps/the-difference-api/settings) - Checkout the branch
ak/stripe_test_key
of the frontend (the-difference-frontend
) and then run it locally - Use fake stripe credit card #
4242 4242 4242 4242
zendesk_helper = ZendeskHelper()
# GET https://thedifference.zendesk.com/api/v2/tickets/{ticket_id}/comments.json
zendesk_helper.get_voice_comment_from_ticket(ticket_id)
# POST https://thedifference.zendesk.com/api/v2/users.json {}
zendesk_helper.create_profile(self)
# PUT https://thedifference.zendesk.com/api/v2/users/{user.zendesk_id}.json
zendesk_helper.update_profile(self / client / user)
# GET https://thedifference.zendesk.com/api/v2/users/search.json?query={email}
zendesk_helper.check_if_user_exists(self.initial_data.get('email') / request.data['email'])
# GET https://thedifference.zendesk.com/api/v2/users/{user.zendesk_id}.json
zendesk_helper.get_zendesk_profile_data(user)
# POST https://thedifference.zendesk.com/api/v2/requests.json
zendesk_helper.create_callback_request(user)
# GET https://thedifference.zendesk.com/api/v2/users/{user.zendesk_id}/tickets/requested.json?sort_order=desc
# DELETE https://thedifference.zendesk.com/api/v2/tickets/{recent_ticket_id}.json
zendesk_helper.cancel_callback_request(user)
# POST https://thedifference.zendesk.com/api/v2/requests.json
zendesk_helper.create_invoice_request(user, requested_id)