Edits history of script submission #22751 for ' Get Sequence (outreach)'

  • bunnative
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    
    /**
     * Get Sequence
     * Retrieves a single sequence by its ID.
     */
    export async function main(auth: RT.Outreach, sequence_id: number) {
      const response = await fetch(
        `https://api.outreach.io/api/v2/sequences/${sequence_id}`,
        {
          headers: {
            Authorization: `Bearer ${auth.token}`,
            Accept: "application/vnd.api+json",
          },
        }
      )
    
      if (!response.ok) {
        throw new Error(`${response.status} ${await response.text()}`)
      }
    
      return await response.json()
    }
    

    Submitted by hugo989 5 hours ago