Docs / Recipes

Recipes

One action does one thing. To get something done you run a few, one after the other: the answer of one gives you what the next one needs. Here are the common ones, step by step.

Every step is one call, made the usual way: a POST with your key in the Authorization header and the body shown.

Find people and invite them

Search for the kind of person you want to meet, then send each one an invitation.

  1. Step 1. Search. Each person in the answer has a profileUrl.

    POST https://api.heyreagent.com/v1/actions/search_people
    
    {
      "keywords": "head of sales",
      "location": "Berlin"
    }

    Everything about this action: search_people

  2. Step 2. Send one invitation per person. Keep the invitationId from the answer if you may want to take it back.

    POST https://api.heyreagent.com/v1/actions/send_invitation
    
    {
      "note": "Hello, I would like to connect.",
      "profileUrl": "FROM_STEP_1"
    }

    FROM_STEP_1 is people[].profileUrl from the answer of step 1. It goes in profileUrl.

    Everything about this action: send_invitation

Take back an invitation nobody answered

See which invitations are still waiting, and withdraw one.

  1. Step 1. List the invitations you sent that are still unanswered.

    POST https://api.heyreagent.com/v1/actions/list_sent_invitations
    
    {}

    Everything about this action: list_sent_invitations

  2. Step 2. Withdraw one. This cannot be undone.

    POST https://api.heyreagent.com/v1/actions/withdraw_invitation
    
    {
      "invitationId": "FROM_STEP_1"
    }

    FROM_STEP_1 is pendingInvitations[].invitationId from the answer of step 1. It goes in invitationId.

    Everything about this action: withdraw_invitation

Read a conversation and reply

Open your inbox, read one conversation, and answer in it.

  1. Step 1. List your unread conversations. Each one has an id.

    POST https://api.heyreagent.com/v1/actions/list_chats
    
    {
      "unread": true
    }

    Everything about this action: list_chats

  2. Step 2. Read the messages of one conversation.

    POST https://api.heyreagent.com/v1/actions/list_chat_messages
    
    {
      "chatId": "FROM_STEP_1"
    }

    FROM_STEP_1 is chats[].id from the answer of step 1. It goes in chatId.

    Everything about this action: list_chat_messages

  3. Step 3. Reply in that same conversation.

    POST https://api.heyreagent.com/v1/actions/send_chat_message
    
    {
      "text": "Thanks for your message!",
      "chatId": "FROM_STEP_1"
    }

    FROM_STEP_1 is chats[].id from the answer of step 1. It goes in chatId.

    Everything about this action: send_chat_message

Answer the invitations you received

See who wants to connect with you, and accept or decline.

  1. Step 1. List the invitations waiting for your answer.

    POST https://api.heyreagent.com/v1/actions/list_received_invitations
    
    {}

    Everything about this action: list_received_invitations

  2. Step 2. Accept (or use "decline").

    POST https://api.heyreagent.com/v1/actions/respond_to_invitation
    
    {
      "action": "accept",
      "invitationId": "FROM_STEP_1"
    }

    FROM_STEP_1 is invitations[].invitationId from the answer of step 1. It goes in invitationId.

    Everything about this action: respond_to_invitation

Invite the people who reacted to a post

Turn the people who liked a post into new connections.

  1. Step 1. Paste the link of the post. The answer lists who reacted and who commented.

    POST https://api.heyreagent.com/v1/actions/get_post_engagers
    
    {
      "postUrl": "PASTE_POST_LINK_HERE"
    }

    PASTE_POST_LINK_HERE: On LinkedIn, click the More icon (the three dots) at the top right of the post, then "Copy link to post".

    Everything about this action: get_post_engagers

  2. Step 2. Send one invitation per person.

    POST https://api.heyreagent.com/v1/actions/send_invitation
    
    {
      "profileUrl": "FROM_STEP_1"
    }

    FROM_STEP_1 is reactors[].linkedinUrl from the answer of step 1. It goes in profileUrl.

    Everything about this action: send_invitation

Search with a LinkedIn filter (for example, a city)

LinkedIn filters take its own ids, not names. First look the id up, then search with it.

  1. Step 1. Look up the id of the place.

    POST https://api.heyreagent.com/v1/actions/lookup_search_ids
    
    {
      "type": "LOCATION",
      "keywords": "Berlin"
    }

    Everything about this action: lookup_search_ids

  2. Step 2. Search with that id as the location filter.

    POST https://api.heyreagent.com/v1/actions/search_linkedin_people
    
    {
      "keywords": "head of sales",
      "location": [
        "FROM_STEP_1"
      ]
    }

    FROM_STEP_1 is matches[].id from the answer of step 1. It goes in location.

    Everything about this action: search_linkedin_people

  3. Step 3. Read one person from the results in full.

    POST https://api.heyreagent.com/v1/actions/get_profile_details
    
    {
      "person": "FROM_STEP_2"
    }

    FROM_STEP_2 is results[].publicProfileUrl from the answer of step 2. It goes in person.

    Everything about this action: get_profile_details

Comment on someone's latest post

Find what a person posted, and leave a comment.

  1. Step 1. List the person's posts, newest first.

    POST https://api.heyreagent.com/v1/actions/list_posts_by_author
    
    {
      "author": "PASTE_PROFILE_LINK_HERE"
    }

    PASTE_PROFILE_LINK_HERE: Open the person's profile on LinkedIn and copy the address from your browser. It looks like https://www.linkedin.com/in/their-name

    Everything about this action: list_posts_by_author

  2. Step 2. Comment on one of them.

    POST https://api.heyreagent.com/v1/actions/comment_on_post
    
    {
      "text": "Great post!",
      "postUrl": "FROM_STEP_1"
    }

    FROM_STEP_1 is posts[].socialId from the answer of step 1. It goes in postUrl.

    Everything about this action: comment_on_post