Invite users
Feature available for: LinkedIn.
Send an invitation to a User
If you are not in relation with a user you can invite them to connect.
To send an invitation to a User, use the POST /users/invite method or the matching SDK method.
In the account_id field, provide the id of the connected account to send the message from. In the provider_id field, give one user's provider internal id. Refer to these guides if you need more information about Users and how their ids work:
Example of inviting someone on LinkedIn
You need to have already connected your LinkedIn account to proceed with this request. Make sure to use the account_id in each request. Note that you can't use a new account for testing, as LinkedIn restricts sending invitations from accounts with low connection history or engagement.
Step 1 · Convert Public ID to Provider ID
For instance, if you want to invite this profile: https://www.linkedin.com/in/satyanadella/, use only the last part of the URL in the Retrieve a profile route.
curl --request GET \
--url https://api.postpress.ai/v1/users/satyanadella?account_id=3H-KVe-mQ2GT9M0hKSkgHgs \
--header 'X-API-KEY: ${POSTPRESS_API_KEY}' \
--header 'accept: application/json'The response will include the profile information, and you need to collect the provider_id (ACoAAAEkwwAB9KEc2TrQgOLEQ-vzRyZeCDyc6DQ) for the next step. For example:
{
"object": "UserProfile",
"provider": "LINKEDIN",
"provider_id": "ACoAAAEkwwAB9KEc2TrQgOLEQ-vzRyZeCDyc6DQ",
"public_identifier": "satyanadella",
"member_urn": "19186432",
"first_name": "Satya",
"last_name": "Nadella",
"headline": "Chairman and CEO at Microsoft"
// ...
}Step 2 · Send the invitation
Now that you have the provider_id, you can proceed to send the invitation.
curl --request POST \
--url https://api.postpress.ai/v1/users/invite \
--header 'X-API-KEY: ${POSTPRESS_API_KEY}' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"provider_id": "ACoAAAEkwwAB9KEc2TrQgOLEQ-vzRyZeCDyc6DQ",
"account_id": "tvKrFOnCQEeTTpO3GNklng",
"message": "Hello\nWorld"
}'