Import multiple messages into Smartify using REST APIs from third party app
Steps
2
Anonymous end-user authentication through APIs
curl -v -X POST -H 'Content-Type:application/json' \
-d '{"id_project":"5e2c35c8f0dbc10017bb3aac", "firstname":"John"}' \
https://panel.smartifyai.in/api/auth/signinAnonymously{
"success":true,
"token":"JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.XYZ....",
"user":{
"_id":"fc43a0e1-ba85-404e-9a44-bf0050330898",
"firstname":"John",
"id":"fc43a0e1-ba85-404e-9a44-bf0050330898",
"fullName":"John"
}
}3
Creating the conversation (request)
curl -v -X POST -H 'Content-Type:application/json' \
-u YOUR_ADMIN_EMAIL:PASSWORD -d '{"sender":"SENDER", "first_text":"FIRST_MESSAGE"}' \
https://panel.smartifyai.in/api/PROJECT_ID/requests/curl -v -X POST -H 'Content-Type:application/json' \
-u [email protected]:xyz \
-d '{"sender":"fc43a0e1-ba85-404e-9a44-bf0050330898", "first_text":"How can i restore my password"}' \
https://panel.smartifyai.in/api/5e2c35c8f0dbc10017bb3aac/requests/{
"_id":"6346cbed38c343d545cf8092",
"request_id":"support-group-5e2c35c8f0dbc10017bb3aac-8e40526e6dfb4450a572cd4ede01f464",
....
}4
Sending messages to a conversation
curl -v -X POST -H 'Content-Type:application/json' \
-u YOUR_ADMIN_EMAIL:PASSWORD \
-d '[{"sender":"bb0d809b-b093-419b-8b48-11a192cc3619","text":"How can i restore my password", "attributes":{"clienttimestamp":1665584701710}},{"sender":"chatbot1", "text":"You can find it here https://tiledesk.com", "attributes":{"clienttimestamp":1665584701711}}]' \
https://panel.smartifyai.in/api/5e2c35c8f0dbc10017bb3aac/requests/support-group-5e2c35c8f0dbc10017bb3aac-8e40526e6dfb4450a572cd4ede01f464/messages/multiImages
Feedback
Links
Last updated