# slb.aflex.upload not working

**URL:** <https://community.a10networks.com/t/slb-aflex-upload-not-working/513>\
**Category:** aFleX\
**Created:** [July 18, 2018, 8:34am UTC](https://community.a10networks.com/t/slb-aflex-upload-not-working/513 "2018-07-18T08:34:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![itsupportWHL](https://avatars.discourse-cdn.com/v4/letter/i/5f8ce5/32.png) [@itsupportWHL](https://community.a10networks.com/u/itsupportWHL)\
**Post date:** [July 18, 2018, 8:34am UTC](https://community.a10networks.com/t/slb-aflex-upload-not-working/513/1 "2018-07-18T08:34:28Z")

</div>

Tried various ways with trying to call the api endpoint direct as well as Axios but I cannot update an Aflex rule programatically. I always get a JSON error ({“code”: 1174, “msg”: “Invalid JSON document.”}}), c:/temp/1.file below is a basic iRule for which I’ve tried to save also in various encodings, ASCII, UTF-8 etc:

####BEGIN Python implementation### import acos\_client as acos c = acos.Client(‘server’, acos.AXAPI\_21, ‘adminuser’, ‘adminpass’) c.slb.aflex.upload(name=“C:/temp/1.file”,aflex=“pycreatedAflex”) ####END Python implementation###

#Raw HTTP# HTTP Request { POST [https://lbname/services/rest/v2.1/?format=json&method=slb.aflex.upload&session\_id=](https://lbname/services/rest/v2.1/?format=json&method=slb.aflex.upload&session_id=)\<hex\_id\_removedforpost\>HTTP/1.1 Host: lbname User-Agent: ACOS-Client-AGENT-1.4.3 Accept-Encoding: gzip, deflate Accept: _/_ Connection: keep-alive Content-type: application/json Content-Length: 180

------------AaB03x Content-Disposition: form-data; name=“upload\_aflex”; filename=“C:/temp/1.file” Content-Type: application/octet-stream

pycreatedAflex ------------AaB03x-- }

{“response”: {“status”: “fail”, “err”: {“code”: 1174, “msg”: “Invalid JSON document.”}}}
