401 error is coming

import base64
import json
import requests
import os

class Pinterest:
@staticmethod
def get_access_token(token_name):
access_token = os.getenv(‘PWD’) + ‘/access_tokens.sh’
f = open(access_token, ‘r+’)
lines = f.readlines()
for line in lines:
tokens = line.strip().split(’=’)
if tokens[0] == token_name:
return tokens[1].strip()

    return 'Not found'

def __init__(self):
    self.page_id = Pinterest.get_access_token('PINTEREST_BOARD_ID')
    self.page_access_token = 
                Pinterest.get_access_token('PINTEREST_ACCESS_TOKEN')



def publish_photo_msg(self, message, image_url):

       url = "https://api.pinterest.com/v1/pins/?board={}&note={}&image_url= 

{}".format(‘Xaheerscc/qeats-app1’,message,image_url)

    payload = 'name=qeats-app1'
    headers = {
        'Authorization': 'Bearer '+self.page_access_token,
        'Content-Type': 'application/x-www-form-urlencoded'
    }

    response = requests.request("POST", url, headers=headers, data = payload) 
    print(response)

if name == ‘main’:
pinterest = Pinterest()

image_url = 'https://assetsds.cdnedge.bluemix.net/sites/default/files/styles/very_big_1/public/feature/images/ice_cream_1.jpg'
my_name = 'x'

message = my_name
pinterest.publish_photo_msg(message, image_url)

please help??