Hi,
I would like to create a Backendless API Service or Event Handler to support third party social media integration into my app. I am using Unipile’s Unified API for accessing a user’s social media account. The user should only need to make this connection once. The account connection API requires the social media account username and password (and service provider name such as MESSENGER) then returns a Unipile account_id, which signifies the link is operational after a checkpoint One Time Password (OTP) code is successfully passed. The account_id is needed as input to other API calls so that is why it needs to be stored and retrievable.
What are the correct logic block sequences to make the connect account API call, then save the API response (returned account_id) in a database separate from the system Users database for ongoing use? The created Unipile account_id would probably need to be linked with the user’s Backendless objectId so that when the user is logged into the app, the app can automatically access the user’s social media account by using their Unipile account_id.
I am trying to use the HTTP/s logic block without success.
Hello @Richard_Elieff
Hi, thanks for your question! I want to be sure I understood your use case correctly:
- You’re using Unipile’s API to connect a user’s social media account (with username, password, provider, and OTP).
- After that, Unipile returns an
account_id. - You would like to store this
account_idin a separate Backendless table (not in the Users table), and link it with the Backendless user’sobjectId. - Later, when the user logs in, your app should automatically retrieve their
account_idto make further Unipile API calls. - You tried doing this with the HTTP/S logic block but haven’t been able to get it working.
Did I capture your requirements correctly?
Yes Viktor. You captured my requirements correctly. To further clarify, Unipile has two different APIs for connecting accounts. I am trying to use the one called “Connect an account (native authentication)” rather than the one called “Connect an account (hosted authentication)”.
Hello, @Richard_Elieff
To help you troubleshoot the HTTPS block issue, could you share what error message or behavior you’re seeing when you run the request?
In the meantime, here are the most common issues with HTTPS blocks:
- Headers: make sure headers are created as an object using the Create Object block, not as text, example:
{ "X-API-KEY": "your-api-key" } - Body format: ensure the body matches Unipile’s requirements
- Error handling: check if the response contains error messages that explain what’s wrong
Once you share the specific error, I can provide more targeted guidance.
Kind regards,
Karyna