{"type":"api","title":"Bulk import of device serial numbers","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-1/f445c17e25a1120e8fbde4bd413083d0fd88b2b3/6c38d1fe-54c3-3c7d-9226-ba8b795939ba","info":{"title":"Crosswork ZTP Service API","description":"Crosswork ZTP Service API for devices, profiles, serial numbers, and static routes. These APIs permit users to add, update, delete, query, and perform bulk CSV import/export of devices and device onboarding operations using ZTP services.","version":"7.1.0","contact":{"name":"Crosswork Team, Cisco","email":"support@cisco.com"},"license":{"name":"Cisco Software License Agreement","url":"http://www.cisco.com/public/sw-license-agreement.html"}},"security":[{"bearerAuth":[]}],"x-parser-conf":{"overview":{"markdownPath":"reference/EMF/ztp-service-deprecated-api-overview.md"}},"openapi":"3.0.1","servers":[{"url":"/crosswork/ztp/v1"}],"securitySchemes":{"bearerAuth":{"description":"Security definitions details.","in":"header","name":"Authorization","type":"apiKey"}}},"spec":{"operationId":"ImportSerialNumbers","deprecated":true,"requestBody":{"content":{"application/json":{"schema":{"description":"Serial Number import object.","properties":{"b64Content":{"description":"base64 enc string of csv/tar file containing serial-numbers/ownership-vouchers","type":"string"},"fileName":{"description":"file name of csv/tar file","type":"string"},"isOverwrite":{"description":"either \"true\" or \"false\"","type":"string"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpSerialNumberImport"},"example":{"b64Content":"u2VyaWFsTnVtYmVyDQpGT0MyMzI5N0hKSw0KS1dDMjMyNDvHSUoNCkZPQzIzmzFSMENYDQpGT0QzNDM0RTddVw0KQ09EMqQzNEU3Q1cmCkdDRTQ1NDVGOERYDQpGT0byMzI4N0hKSw0K"}}},"description":"The information used to add bulk serialnumbers.","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"Serial Number import response object.","properties":{"code":{"description":"Response code. Indicates success/failure.","format":"int32","type":"integer"},"duplicateRecordCount":{"description":"Duplicate record count.","format":"int32","type":"integer"},"message":{"description":"Response message. Indicates success/failure reason.","type":"string"},"processedRecordCount":{"description":"Processed record count.","format":"int32","type":"integer"},"warningRecordCount":{"description":"Warning record count.","format":"int32","type":"integer"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpSerialNumberImportResponse"},"examples":{"Success Response":{"value":{"code":201,"message":"Imported Successfully","processedRecordCount":50,"duplicateRecordCount":0}},"Invalid Input":{"value":{"code":400,"message":"Unable to read csv content."}},"Data Persistence Failure":{"value":{"code":500,"message":"Error while saving in DB."}},"Service Unavailable":{"value":{"code":503,"message":"Sorry, ztp service is in maintenance mode. Only read operations are supported."}}}}},"description":"OK. The request was successful. The result is contained in the response body."},"401":{"description":"Unauthorized. The request has not been applied because it lacks valid authentication credentials for the target resource."},"403":{"description":"Forbidden. The server recognizes the authentication credentials, but the client is not authorized to perform this request."},"404":{"description":"Not Found. The client made a request for a resource that does not exist."}},"summary":"Bulk import of device serial numbers","description":"Lets users import device serial numbers in bulk from a comma-separated values (CSV) file.","tags":["Voucher & Serial Number APIs"],"__originalOperationId":"ImportSerialNumbers","security":[{"bearerAuth":[]}],"method":"post","path":"/serialnumbers/import"}}