Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage Incident gives error #32

Closed
RSamal opened this issue Sep 14, 2016 · 6 comments
Closed

Manage Incident gives error #32

RSamal opened this issue Sep 14, 2016 · 6 comments
Labels

Comments

@RSamal
Copy link

RSamal commented Sep 14, 2016

I am trying to call from golang library with the below code
`incident := Incident{
Id: "PQOWA9O",
Type: "incident_reference",
Status: "acknowledged",
}

opts := ManageIncidentsOptions{
    From: "samal.ramakanta@gmail.com",
}
incidents := []Incident{incident}
err := client.ManageIncidents(incidents, opts)
if err != nil {
    t.Error(err.Error())
}`

But getting below error
pagerduty_test.go:37: Failed call API endpoint. HTTP response code: 400. Error: &{2016 You must specify a user's email address in the "From" header to perform this action []}

@ranjib ranjib added the bug label Sep 14, 2016
@RSamal
Copy link
Author

RSamal commented Sep 14, 2016

I changed the client and added email as part of the header in Do request . It works for my scenario but I am not sure if it broke other test cases .
`// Client wraps http client
type Client struct {
authToken string
email string
}

req.Header.Set("From", c.email)
`

@ranjib
Copy link
Contributor

ranjib commented Sep 14, 2016

@RSamal thats it. I am updating the library to allow passing additional headers. Give me a day, and this will be fixed. Thanks for reporting.

@ranjib
Copy link
Contributor

ranjib commented Sep 14, 2016

@RSamal I just merged #33 , which should fix this, I changed the method signature to pass "From" value as string argument
Let me know if the issue still persist.

@ranjib
Copy link
Contributor

ranjib commented Sep 19, 2016

@RSamal closing this. Let me know if the error persist

@ranjib ranjib closed this as completed Sep 19, 2016
@RSamal
Copy link
Author

RSamal commented Sep 28, 2016

Thank you it works . Sorry for the delay in response.

I had a question, do we have any event api usecases written in golang?

@ranjib
Copy link
Contributor

ranjib commented Sep 28, 2016

@RSamal #41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants