{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Quickstart","description":"Build integrations with 3Chat APIs and webhook events."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"quickstart","__idx":0},"children":["Quickstart"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This quickstart creates an Access Token and uses it to make a read-only request to the 3Chat API."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"1-create-an-openapi-application","__idx":1},"children":["1. Create an OpenAPI application"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create or open an application in 3Chat Open Platform. Copy the application's ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["App Key"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["App Secret"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Store both values in a secure server-side environment. The App Secret must never be included in browser or mobile application code."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"2-create-an-access-token","__idx":2},"children":["2. Create an Access Token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Send the App Key and App Secret to the token endpoint:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl --request POST \\\n  --url 'https://app.3chat.ai/api/open/v3/token' \\\n  --header 'content-type: application/json' \\\n  --data '{\n    \"body\": {\n      \"appKey\": \"your_app_key\",\n      \"appSecret\": \"your_app_secret\"\n    }\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A successful response contains an Access Token, a Refresh Token, and their expiration values:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"code\": 0,\n  \"message\": \"\",\n  \"data\": {\n    \"entity\": {\n      \"accessToken\": \"your_access_token\",\n      \"accessTokenExpireIn\": 0,\n      \"refreshToken\": \"your_refresh_token\",\n      \"refreshTokenExpireIn\": 0\n    }\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the expiration values returned by the API. The zero values above only illustrate the response structure."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"3-call-an-authenticated-api","__idx":3},"children":["3. Call an authenticated API"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Send the Access Token in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," header:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl --request POST \\\n  --url 'https://app.3chat.ai/api/open/v3/currentStaff/query' \\\n  --header 'authorization: Bearer your_access_token' \\\n  --header 'content-type: application/json'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The request is successful when the API returns a success code and the current staff member in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.entity"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"4-refresh-the-access-token","__idx":4},"children":["4. Refresh the Access Token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before the Access Token expires, exchange the Refresh Token for a new token pair:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl --request PUT \\\n  --url 'https://app.3chat.ai/api/open/v3/token' \\\n  --header 'content-type: application/json' \\\n  --data '{\n    \"body\": {\n      \"refreshToken\": \"your_refresh_token\"\n    }\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If the Refresh Token has expired, call the Create Access Token endpoint again with the App Key and App Secret."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":5},"children":["Next steps"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Read the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/quickstart"},"children":["API overview"]}," for authentication, request conventions, resource groups, and error handling."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authentication API"]}," group in the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/3chat-api"},"children":["API Reference"]}," for the complete token lifecycle."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Explore API groups such as ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Agent"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Dialog"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Visitor"]},", and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Conversation"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Read the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/webhooks-overview"},"children":["Webhooks overview"]}," before subscribing to events."]}]}]},"headings":[{"value":"Quickstart","id":"quickstart","depth":1},{"value":"1. Create an OpenAPI application","id":"1-create-an-openapi-application","depth":2},{"value":"2. Create an Access Token","id":"2-create-an-access-token","depth":2},{"value":"3. Call an authenticated API","id":"3-call-an-authenticated-api","depth":2},{"value":"4. Refresh the Access Token","id":"4-refresh-the-access-token","depth":2},{"value":"Next steps","id":"next-steps","depth":2}],"frontmatter":{"title":"Quickstart","description":"Create an access token and make your first authenticated 3Chat API request.","seo":{"title":"Quickstart"}},"lastModified":"2026-09-18T09:18:24.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/quickstart-3chat","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}