Skip to content

Commit 5fd634c

Browse files
committed
Resolved issue with create_user
1 parent 48b897d commit 5fd634c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

REST_API_v2/Users/create_user.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,17 @@
2424
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2525
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2626
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27-
#
28-
# FIXME receiving 2001 - Name cannot be empty
2927

3028
import requests
3129
import json
3230

3331
# Update to match your API key
3432
API_KEY = '3c3gRvzx7uGfMYEnWKvF'
3533

36-
# Update to match your chosen parameters
34+
# Update to match your PagerDuty email address
35+
PD_EMAIL = 'lucas@pagerduty.com'
36+
37+
# Update to match your chosen parameters for the new user
3738
NAME = 'Insert user name here'
3839
EMAIL = 'insert_email@here.com'
3940
ROLE = 'user' # Can be one of admin, user, team_responder, limited_user, read_only_user
@@ -43,7 +44,8 @@ def create_user():
4344
headers = {
4445
'Accept': 'application/vnd.pagerduty+json;version=2',
4546
'Authorization': 'Token token=' + API_KEY,
46-
'Content-type': 'application/json'
47+
'Content-type': 'application/json',
48+
'From': PD_EMAIL
4749
}
4850
payload = {
4951
'user': {

0 commit comments

Comments
 (0)