Profile Images


Upload an image to an existing user's profile.

POST https://api.uship.com/v2/profiles/images

 

Request Header Value
Content-Type multipart/formdata
Form-data Sub Content-Type Headers

Must support the following media types:

  • image/jpg
  • image/jpeg
  • image/png
  • image/gif

The sub content-type media type must match the image file type.

Input Request Body

Chrome Postman - REST Client screenshot

When testing with POSTman, do not send the "content-type" header.

Chrome Postman - REST Client screenshot

 

Set Primary Image

Optional. To set the image as the profile's primary image, set the sub content-type application/json with this body:

{
"primary": true
}

 

Response

Success Status: 201 Created

Response Header

Location Header

https://api.uship.com/resize.php?path=%2fstatic%2fusers%2f82349b33-1371-46cc-8.png 

 

Did My Image Upload Correctly?

Retrieve the user's summary and see the order of the profile images

GET https://api.uship.com/v2/users/{userId}/profile

 

Sample Response

See https://developer.uship.com/docs/read/apis/User_Profile for field descriptions.

{
    "userSummary": {
        "userId": 123456789,
        "displayName": "TexasCowgirl",
        "imageUrl": "https://api.uship.com/resize.php?path=%2fstatic%2fusers%2f45c0d795-249a-45ba-a.png",
        "feedback": {
            "count": 10,
            "percentPositive": 100,
            "starRating": 5
        },
        "links": [
            {
                "rel": "Item",
                "verb": "GET",
                "href": "/v2/users/123456789/profile",
                "title": "profile"
            }
        ]
    },
    "createdOn": "2013-05-21T22:37:54Z",
    "userType": {
        "value": "ShipperAndServiceProvider",
        "label": "Shipper & Service Provider",
        "shortLabel": "Shipper & Service Provider"
    },
    "status": {
        "value": "Active",
        "label": "Active",
        "shortLabel": "Active"
    },
    "about": "dev",
    "images": [
        "http://api.uship.com/resize.php?path=%2fstatic%2fusers%2f45c0d795-249a-45ba-a.png",
        "http://api.uship.com/resize.php?path=%2fstatic%2fusers%2f314836b2-774b-47d1-9.png",
        "http://api.uship.com/resize.php?path=%2fstatic%2fusers%2f14d94c53-bb06-48d0-a.png",
        "http://api.uship.com/resize.php?path=%2fstatic%2fusers%2f255475f0-9184-4dda-b.png",
        "http://api.uship.com/resize.php?path=%2fstatic%2fusers%2fea144890-c527-44e7-b.png"
    ]
}