I have a supplier that offers their personalisation preview tool through their API. They informed the API isn't native to Shopify, so it would require some tweaking. This is the suppliers website and if you go down and type in something and click "Enter" it will generate a preview for the typed term on the product through the API. ([login to view URL]).
I have all the product feed CSV including the characters limits and lines for each products. They informed that "If you are able to convert the code into whatever development environment you are using, we will be able to set you up your own credentials" and included with below a python example to make personalisation image requests. They also informed for the question "Do I have to write 500 codes for 500 products each to request preview for each product? – No they will use the variable from said products to insert into the code. So one piece of code many variables."
They said the way to go would be creating a custom app to integrate the API. This is all the information I have at the moment but if this seems something you can help please respond with "LONDON" and then I can add you in the email and you can discuss with them directly.
Cheers,
Dee
import hashlib
import [login to view URL]
def printgeneration():
username = 'SealAccount'
public_key = '3169D9B8'
secret_key = "B4F74C611688304783834DC103C97E0F86C2C18C9014734E"
pers_sku = 'P071176'
pers_line1 = 'Mr & Mrs Eaton'
pers_line2 = 'Lots of Love x'
stringtohash = """set{}tPers{{$Line1={};Line2={}$}}pw600co80u{}{}""".format(pers_sku, pers_line1, pers_line2, username, secret_key)
stringtohashplaceholder = """set{product_sku}tPers{{$Line1={personalisation}$}}pw600co80u{username}{secret_key}"""
print(stringtohash)
print('These are my Variables.....')
print(' ')
print('Username: {}'.format(username))
print('Product Sku : {}'.format(pers_sku))
print('Personalisation : Line 1 {} Line2 {}'.format(pers_line1, pers_line2))
print('')
print('Secret Key : {}'.format(secret_key))
print('Public Key : {}'.format(public_key))
print('')
print('This is my string to hash with placeholders.........')
print(stringtohashplaceholder)
print('')
print('This is my string to Hash')
print('{}'.format(stringtohash))
encypter = [login to view URL]([login to view URL]())
value = [login to view URL]()
print('This is my hashed string....'.format(value))
print('{}'.format(value))
print('')
print('This is the final url with the Seal you have created above added to the request string...')
pers_string = "{{$Line1={};Line2={}$}}".format(pers_line1, pers_line2)
pers_for_main_url = urllib.parse.quote_plus(pers_string)
#Pers{$ Line1 =Phillip$}
final_url = '[login to view URL]{}&t=Pers{}&pw=600&co=80&u={}&Seal={}'.format(pers_sku, pers_for_main_url, username, value)
print(final_url)
pass
if __name__ == '__main__':
printgeneration()
I have done similar project. Details as below.
API Integration by passing different values from predefined in an excel or csv to the variable of the api. Programmatically invoked the api and results are converted to excel format which should be user friendly.
Hi, I am a pro level Website developer and have been helping clients in similar web development projects since past 5 years. I believe my professional skills and working experience make me eligible for this project.
Lets chat for further discussion
Thanks,
Hamza.