This repository has been archived by the owner on Mar 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
ForwardFax
Michael Fridman edited this page Sep 11, 2018
·
6 revisions
See the official Forward_Fax docs for more info.
In this example we'll forward a fax from the inbox to another fax number. The identifier is the fax name, 20180318202314-2472-1_1|389091786
, but we could also have used 389091786
.
NOTE: If supplying more than one fax number the FaxType must be "BROADCAST",
- otherwise will get error:
Failed: Invalid Fax Number /
cfg := srfax.ForwardCfg{
Identifier: "20180318202314-2472-1_1|389091786", // Either fax name or details id
Direction: srfax.Inbound, // Inbound (received) or Outbound (sent)
CallerID: 6476892276, // Sender's fax number (must be 10 digits)
SenderEmail: "mf192@icloud.com", // Sender's email address
FaxType: "SINGLE", // "SINGLE" or "BROADCAST"
// Slice of 11 digit numbers represented as strings
ToFaxNumber: []string{"16476892276"},
}
// Options are optional. This is just an example of how one might use them.
opts := srfax.ForwardOptions{
AccountCode: "internal message", // Internal Reference Number (20 chars max)
}
resp, err := client.ForwardFax(cfg)
if err != nil {
log.Fatalln(err)
}
srfax.PP(resp) // pretty print the output
Output:
NOTE: the returned job id in the result field will be a string (not int)
{
"Status": "Success",
"Result": "389090860"
}