{"type":"api","title":"Add single or multiple 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":"AddSerialNumbers","deprecated":true,"requestBody":{"content":{"application/json":{"schema":{"description":"Serial Number List object.","properties":{"data":{"description":"Serial Number list.","items":{"description":"Serial Number object.","properties":{"isInUse":{"description":"either \"true\" or \"false\"","type":"string"},"isOvLinked":{"description":"either \"true\" or \"false\"","type":"string"},"modifiedDate":{"format":"int64","description":"last modified date in unix time format","type":"integer"},"ovContent":{"description":"base64 enc string of ownership voucher file","type":"string"},"ovFilename":{"description":"ownership voucher file name","type":"string"},"serialNumber":{"description":"The serial number of the device","type":"string"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpSerialNumber"},"type":"array"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpSerialNumberList"},"example":{"data":[{"serialNumber":"ABCD1234EFGH"},{"serialNumber":"ABCD1234EFGG"}]}}},"description":"The information used to add serial number.","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"Serial Number response object.","properties":{"code":{"description":"Response code. Indicates success/failure.","format":"int32","type":"integer"},"data":{"description":"List of Serial Number object data.","items":{"description":"Serial Number object.","properties":{"isInUse":{"description":"either \"true\" or \"false\"","type":"string"},"isOvLinked":{"description":"either \"true\" or \"false\"","type":"string"},"modifiedDate":{"format":"int64","description":"last modified date in unix time format","type":"integer"},"ovContent":{"description":"base64 enc string of ownership voucher file","type":"string"},"ovFilename":{"description":"ownership voucher file name","type":"string"},"serialNumber":{"description":"The serial number of the device","type":"string"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpSerialNumber"},"type":"array"},"message":{"description":"Response message. Indicates success/failure reason.","type":"string"},"pagination":{"description":"Used to filter results, paginationin device and other APIs.","properties":{"Criteria":{"description":"Response filter criteria. Not used.","type":"string"},"Descending":{"description":"Order response in ascending/descending order. Default value: \"false\"","format":"boolean","type":"boolean"},"MatchCase":{"description":"Do case matching. Not used.","format":"boolean","type":"boolean"},"PageNum":{"description":"Page number in the list of generated records, paginated by \"PageSize\". Starts with 0.","format":"int64","type":"integer"},"PageSize":{"description":"Number of records to be returned in a response.","format":"int64","type":"integer"},"SortBy":{"description":"Field to be used for sorting responses.","type":"string"},"TotalCount":{"description":"Total number of records matching the query criteria.","format":"int64","type":"integer"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpFilterData"}},"type":"object","$$ref":"#/components/schemas/cwztpsvcZtpSerialNumberResponse"},"examples":{"Success Response":{"value":{"code":201,"message":"Created Successfully","processedRecordCount":50,"duplicateRecordCount":0}},"Invalid Input":{"value":{"code":400,"message":"Error while encrypting OV."}},"Invalid Request Body":{"summary":"Invalid Request Body","value":{"code":422,"message":"invalid character '}' looking for beginning of value"},"$$ref":"#/components/examples/Invalid_Request_Body"},"Data Persistence Failure":{"value":{"code":500,"message":"Failed to save data. DB error."}},"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":"Add single or multiple device serial numbers","description":"Allows users to add single or multiple device serial numbers.","tags":["Voucher & Serial Number APIs"],"__originalOperationId":"AddSerialNumbers","security":[{"bearerAuth":[]}],"method":"post","path":"/serialnumbers"}}